仅使用BigQuery数据定义语言和标准SQL,是否可以将当前日期用作变量,以将其用作以下查询中的-posts(Collection)
|
+---{userID} (Document)
|
+---userPosts (collection)
|
+---{Documents to be checked} (Document)
|
+-Url1(field)
+-Url2(field)
+-string1(field)<- check this field for swear
+-string2(field)<- check this field for swear
路径?
gs://
答案 0 :(得分:1)
EXECUTE IMMEDIATE format("""
CREATE OR REPLACE EXTERNAL TABLE staging.my_table
OPTIONS (
format = 'NEWLINE_DELIMITED_JSON',
uris = ['gs://bucket/path/to/%s/*.jsonl']
)
""", CAST(CURRENT_DATE() AS STRING));
最佳做法是在GCS上使用Hive partitioning