使用happybase将csv文件加载到hbase时出错

时间:2017-02-01 11:41:38

标签: hbase happybase

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

使用的版本:

Happybase 0.9

Python 2.6.6

MapRDB

TypeError:期望列表/集类型args的大小为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

屏幕截图错误: enter image description here

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试降级旧货库。

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

不过,错误报告的正确位置是在github上,而不是在stackoverflow上。