简体   繁体   English

如何将多个文件(相同模式)从 LOCAL 加载到 BigQuery 中的表中?

[英]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.

相关问题 无法将 json 文件中的数据加载到 bigquery,因为 json 在不同情况下具有相同的键 - Unable to load the data from json files to bigquery, as the jsons have same key with different cases Bigquery - 插入现有表 - 来自本地 CSV - Bigquery - INSERT into Existing table - from local CSV 从 pandas 数据框创建一个 BigQuery 表,无需明确指定架构 - Create a BigQuery table from pandas dataframe, WITHOUT specifying schema explicitly 如何创建表编号列使用 python 到 bigquery load_table_from_dataframe - how to create table number columns use python to bigquery load_table_from_dataframe Bigquery 将列添加到表架构 - Bigquery add columns to table schema 如何从 GCS 将数据加载到 BigQuery(使用 load_table_from_uri 或 load_table_from_dataframe)而不复制 BQ 表中的现有数据 - how to load data into BigQuery from GCS (using load_table_from_uri or load_table_from_dataframe) without duplicating existing data in the BQ table 将多个文件从 Cloud Storage 导入 BigQuery 的命令 - Command to import multiple files from Cloud Storage into BigQuery 如何使用 BigQuery 从另一个表中获取包含相同项目的交易? - How do I get transactions that contains the same items from another table using BigQuery? 每天我都会在 BigQuery 中收到一个新表,我想将这个新表数据连接到主表,数据集架构相同 - Daily I’m receiving a new table in the BigQuery, I want concatenate this new table data to the main table, dataset schema are same BigQuery 如何通过相同的规则更新多个数字列? - BigQuery How to update multiple numeric columns by the same rule?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM