如何在API上设置bigquery表的数据位置? [英] How do I set the data location of a bigquery table over the API?
问题描述
我试图以编程方式创建表格,但我无法弄清楚如何设置数据位置,即数据的存储位置。在用户界面中,我可以选择美国和欧盟,但根据这里的文档: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#resource 位置
字段仅输出。
I'm trying to create tables programmatically, but I can't figure out how I set the data location, that is, where the data is stored. In the UI I can choose between "US" and "EU", but according to the docs here: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#resource the location
field is output only.
我正在使用节点来做这件事,但那应该不重要。我正在使用的方法是: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.2/bigquery/dataset?method=createTable
I'm using node for doing it, but that shouldn't matter. The method I'm using is here: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.2/bigquery/dataset?method=createTable
推荐答案
位置设置为数据集级别,而不是表格
因此,您应该考虑 https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#resource
Location is set on Dataset Level, not table
So you should rather look into https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#resource
这篇关于如何在API上设置bigquery表的数据位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!