正在尝试将csv文件加载到hbase,但在运行getting时出错:
使用的版本:
快乐基0.9
python 2.6.6版
Map数据库
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
屏幕截图错误:
任何帮助都将不胜感激。
1条答案
按热度按时间62lalag41#
试着降低旧图书馆的等级。
https://github.com/wbolster/happybase/issues/154
顺便说一句,错误报告的正确位置是github,而不是stackoverflow。