以下是一个示例外部表元数据文件: { "configuration": { "sourceFormat": "NEWLINE_DELIMITED_JSON", "sourceUris": [ "gs://mybucket/myfile1.json", "gs://mybucket/myfile2.json" ], "schema": { "fields": [ { "name": "name", "type": "STRING" }, { "name": "age", "type": "INTEGER" } ] } } }
其中,/path/to/metadata.json是外部表元数据文件的路径,mydataset.mytable是您想要创建的外部表的名称。
这将返回存储在您提供的GCS位置的数据的所有行。
注意:在使用BigQuery中的外部表时,请确保具有适当的读取权限,并且您的存储桶位于同一Google Cloud项目中。
上一篇:BigQuery外部表格