diff --git a/parsons/google/google_bigquery.py b/parsons/google/google_bigquery.py index c606242755..aef6ffaf88 100644 --- a/parsons/google/google_bigquery.py +++ b/parsons/google/google_bigquery.py @@ -782,6 +782,15 @@ def copy( self._validate_copy_inputs(if_exists=if_exists, data_type=data_type) + # If our source table is loaded from CSV with no transformations + # The original source file will be directly loaded to GCS + # We may need to pass along a custom delimiter to BigQuery + # Otherwise we use the default comma + if isinstance(tbl.table, petl.io.csv_py3.CSVView): + csv_delimiter = tbl.table.csvargs.get("delimiter", ",") + else: + csv_delimiter = "," + job_config = self._process_job_config( job_config=job_config, destination_table_name=table_name, @@ -796,6 +805,7 @@ def copy( allow_jagged_rows=allow_jagged_rows, quote=quote, custom_schema=schema, + csv_delimiter=csv_delimiter, ) # Reorder schema to match table to ensure compatibility