【问题标题】:Bigtable bulk insertBigtable 批量插入
【发布时间】:2018-05-31 12:16:37
【问题描述】:
【问题讨论】:
标签:
python
google-cloud-bigtable
【解决方案2】:
如果你在 google-bigtable 中使用 happybase API,你可以使用 bigtable happybase 批处理方法
from google.cloud import bigtable,happybase
client = bigtable.Client(project=my_project_id, admin=True)
bigtable_instance= client.instance(my_instance_id)
bt_connection = happybase.Connection(instance=bigtable_instance)
bt_table = bt_connection.table(my_bigtable_name)
bt_batch_actions = bt_table.batch()
for key,val in my_info.items():
bt_batch_actions.put(key.encode('utf-8'):val.encode('utf-8'))
bt_batch_actions.send()
希望这会有所帮助!
【解决方案3】:
谷歌云 python 库现在实际上只支持一个网络请求的批处理。它叫做mutations_batcher,文档可以在here找到。