Your default location can be set in the .bigqueryrc file. The schema's location can be set using the bq
command, like this:
bq --location=location load \
--source_format=format \
project_id:dataset.table_name \
path_to_source \
schema
Where:
location
is the name of your location. The--location
flag is optional. For example, if you are using BigQuery in the Tokyo region, you can set the flag's value toasia-northeast1
. You can set a default value for the location using the .bigqueryrc file.- format is
NEWLINE_DELIMITED_JSON
orCSV
.- project_id:dataset.table_name is your project ID.
- project_id:dataset.table_name is the dataset that contains the table into which you're loading data.
- project_id:dataset.table_name is the name of the table into which you're loading data.
- path_to_source is the location of the CSV or JSON data file on your local machine or in Cloud Storage.
- schema is the inline schema definition.
Example:
Enter the following command to load data from a local CSV file named
myfile.csv
intomydataset.mytable
in your default project. The schema is manually specified inline.
bq load \
--source_format=CSV \
mydataset.mytable \
./myfile.csv \
qtr:STRING,sales:FLOAT,year:STRING
More on locations here.
Both your encoding and locale are suspect based on the details you have provided.