[英]How to load multiple files (same schema) from LOCAL into a table in BigQuery?
I have multi-files in a folder in my local machine.我的本地计算机的一个文件夹中有多个文件。 And every file has the same schema.每个文件都有相同的模式。 how can I upload those files into BQ in one line cli?如何通过一行 cli 将这些文件上传到 BQ? I tried this:我试过这个:
bq load --source_format=NEWLINE_DELIMITED_JSON --ignore_unknown_values temp.test_load./*./schema.json
But I got this error Too many positional args, still have...
(and continues with the name of all files in the folder)但是我得到了这个错误Too many positional args, still have...
(并继续文件夹中所有文件的名称)
But when I specife the file name, it uploads it into BQ without any error:但是当我指定文件名时,它会毫无错误地将其上传到 BQ:
bq load --source_format=NEWLINE_DELIMITED_JSON --ignore_unknown_values temp.test_load./file_1.ndjson.gz./schema.json
(this one is working) bq load --source_format=NEWLINE_DELIMITED_JSON --ignore_unknown_values temp.test_load./file_1.ndjson.gz./schema.json
(这个有效)
How can I make multi uploads from local?如何从本地进行多次上传?
When loading data from local files to BigQuery, files can only be loaded individually as the Wildcards and comma-separated lists are not supported for loading data from local files.从本地文件加载数据到 BigQuery 时,只能单独加载文件,因为不支持从本地文件加载数据时使用通配符和逗号分隔列表。
The Wildcards are only supported if you are loading data from Cloud Storage to BigQuery, provided all the files share a common base-name.仅当您将数据从 Cloud Storage 加载到 BigQuery 时才支持通配符,前提是所有文件都共享一个通用的基本名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.