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

oxcyiej7  于 2021-06-10  发布在  Hbase
关注(0)|答案(1)|浏览(527)

正在尝试将csv文件加载到hbase,但在运行getting时出错:
使用的版本:
快乐基0.9
python 2.6.6版
Map数据库
typeerror:列表/集类型参数需要大小为3的元组
下面是使用的代码

  1. import csv
  2. import happybase
  3. # CSV file of customer records -- change me
  4. f = '/mapr/demo.mapr.com/project/cust.csv'
  5. ufile = open(f)
  6. reader = csv.DictReader(ufile)
  7. conn = happybase.Connection('localhost')
  8. table = conn.table('cust_table')
  9. print "reading customer file %s" % f
  10. i = 0
  11. for row in reader:
  12. i += 1
  13. table.put(row['CustID'],
  14. {'cdata:name': row['Name'],
  15. 'cdata:gender': row['Gender'],
  16. 'cdata:address': row['Address'],
  17. 'cdata:zip': row['zip'],
  18. 'cdata:signdate': row['SignDate'],
  19. 'cdata:status': row['Status'],
  20. 'cdata:level': row['Level'],
  21. 'cdata:campaign': row['Campaign'],
  22. # 'cdata:linked_with_apps': row['LinkedWithApps']
  23. })
  24. print "loaded cust db with %d entries" % i

屏幕截图错误:

任何帮助都将不胜感激。

62lalag4

62lalag41#

试着降低旧图书馆的等级。
https://github.com/wbolster/happybase/issues/154
顺便说一句,错误报告的正确位置是github,而不是stackoverflow。

相关问题