How to load multiple files (same schema) into a table in BigQuery?

后端 未结 3 541
心在旅途
心在旅途 2020-12-20 16:51

I have a folder of csv files with the same schema that I want to load into a bigquery table.

Is there an option to give folder path as the input to BQ command to lo

3条回答
  •  被撕碎了的回忆
    2020-12-20 17:15

    The files can be in subdirectories, if you want to recursively include all CSV:

    bq load --source_format=CSV \
    dataset_name.table_name \
    "gs://my_bucket/folder/*.csv"
    

    This puts a wildcard on intermediate path and filename. (ex. * expands to subfolder/folder2/filename)

提交回复
热议问题