Mik*_*ant 14
您可以使用 DDL 的 statamenet CREATE TABLE IF NOT EXISTS为此。例如
#standardSQL
CREATE TABLE IF NOT EXISTS mydataset.newtable (x INT64, y STRUCT<a ARRAY<STRING>, b BOOL>)
OPTIONS(
expiration_timestamp=TIMESTAMP "2020-01-01 00:00:00 UTC",
description="a table that expires in 2020",
labels=[("org_unit", "development")]
)
Run Code Online (Sandbox Code Playgroud)
或通过命令行
bq query --use_legacy_sql=false '
CREATE TABLE IF NOT EXISTS mydataset.newtable (x INT64, y STRUCT<a ARRAY<STRING>, b BOOL>)
OPTIONS(
expiration_timestamp=TIMESTAMP "2020-01-01 00:00:00 UTC",
description="a table that expires in 2020",
labels=[("org_unit", "development")]
)'
Run Code Online (Sandbox Code Playgroud)