Loading Data from Google Cloud Storage

I was trying to load multiple csv files as table on my dataset, how can I load all the files at once on my dataset.

1 option is to select all the files manually one by one. Is there any better option, like a command line to load all the tables to the dataset.

0 2 524
2 REPLIES 2

Yes, you can ingest your data directly into the console note that on the console you can’t make use of commas or  you can use the next command:

 

bq --location=location load \

--source_format=format \

dataset.table \

path_to_source \

schema

 

  • On the Source/ Path_to_source is a fully-qualified Cloud Storage URI or a comma-separated list of URIs. Wildcards are also supported.

Note that you can only read your data directly from one folder to do this you would need to run the command specifying your bucket as gs://bucket/ this will read your entire folder and subfolders, if you  want to read your bucket as gs://bucket/*/* you will only read the first level of the folder.

Thanks 😊