Loads a local or Cloud Storage–hosted CSV file into a BigQuery table via bq CLI, Web UI, or scheduled job.
CSV remains the fastest way to bulk-load data from spreadsheets, exports, or third-party tools into BigQuery when APIs aren’t available.It lets analysts start querying immediately without writing ETL code.
Choose between the bq
CLI for automation, the Cloud Console for ad-hoc loads, or Scheduled Queries to refresh the table on a timetable.
Run bq load
with --source_format=CSV
, supply your schema, and point to a local file or gs://
URI.Use --autodetect
to infer column types fast.
The command below loads customers.csv
into ecom.Customers
, skips headers, keeps nulls, and creates the table if needed.
bq load --source_format=CSV \
--skip_leading_rows=1 \
--field_delimiter="," \
--allow_quoted_newlines \
ecom.Customers \
id:INT64,name:STRING,email
:STRING,created_at:TIMESTAMP \
gs://galaxy_uploads/customers.csv
Inside BigQuery, click “Create Table,” pick “Upload” or “Cloud Storage,” select CSV, toggle “Auto detect,” and confirm.The UI mirrors CLI flags under the hood.
Create a Cloud Storage bucket with daily drops, then add a Scheduled Query or Cloud Scheduler + Cloud Functions job that triggers the same bq load
command.
• Compress files with GZIP to cut transfer time.
• Match column order between CSV and schema.
• Use UTC timestamps to avoid daylight-savings surprises.
Dropping the header row but forgetting --skip_leading_rows=1
causes BigQuery to treat column names as data.
Uploading a local file larger than 10 MB in the UI fails; move it to Cloud Storage first.
Run SELECT COUNT(*) FROM ecom.Customers;
to confirm row count, or inspect the Load Job history for errors and bytes processed.
.
Yes. With --autodetect
or UI Auto Detect checked, BigQuery infers the schema and creates the table if it doesn't exist.
Omit the --replace
flag (CLI) or choose "Append to table" in the UI to keep existing data and add new rows.
Individual rows cannot exceed 100 MB after base-64 encoding. Split exceptionally wide rows or switch to Avro/Parquet for complex structures.