首页 > 解决方案 > 如何从 BigQuery 导出到数据存储区?

问题描述

我在 BigQuery 中有要在 Datastore 中导出和导入的表。如何做到这一点?

标签: google-bigquerygoogle-cloud-datastore

解决方案


BigQuery 中的表可以导出和导入到您的数据存储区。

从https://github.com/yu-iskw/bigquery-to-datastore/releases下载 jar 文件

然后运行命令

java -cp bigquery-to-datastore-bundled-0.5.1.jar com.github.yuiskw.beam.BigQuery2Datastore --project=yourprojectId --runner=DataflowRunner  --inputBigQueryDataset=datastore  --inputBigQueryTable=metainfo_internal_2 --outputDatastoreNamespace=default --outputDatastoreKind=meta_internal  --keyColumn=key --indexedColumns=column1,column2 --tempLocation=gs://gsheetbackup_live/temp  --gcpTempLocation=gs://gsheetlogfile_live/temp

--tempLocation并且--gcpTempLocation是有效的云存储桶 url。

--keyColumn=key- 这里的关键是你的大查询表上的唯一字段


推荐阅读