0

尝试将 csv 文件加载到 hbase,但在运行时出现错误:

使用的版本:

快乐基地 0.9

Python 2.6.6

地图数据库

TypeError:对于列表/集合类型参数,期望大小为 3 的元组

下面是使用的代码

import csv
import happybase

# CSV file of customer records -- change me
f = '/mapr/demo.mapr.com/project/cust.csv'

ufile = open(f)
reader = csv.DictReader(ufile)
conn = happybase.Connection('localhost')
table = conn.table('cust_table')

print "reading customer file %s" % f
i = 0
for row in reader:
    i += 1
    table.put(row['CustID'],
        {'cdata:name': row['Name'],
         'cdata:gender': row['Gender'],
         'cdata:address': row['Address'],
         'cdata:zip': row['zip'],
         'cdata:signdate': row['SignDate'],
         'cdata:status': row['Status'],
         'cdata:level': row['Level'],
         'cdata:campaign': row['Campaign'],
#         'cdata:linked_with_apps': row['LinkedWithApps']
})
print "loaded cust db with %d entries" % i

截图错误: 在此处输入图像描述

任何帮助,将不胜感激。

4

1 回答 1

0

尝试降级节俭库。

https://github.com/wbolster/happybase/issues/154

顺便说一句,错误报告的正确位置是在 github 上,而不是在 stackoverflow 上。

于 2017-02-03T17:39:36.520 回答