Kiollpt opened a new issue #16578:
URL: https://github.com/apache/airflow/issues/16578
<!--
Welcome to Apache Airflow! For a smooth issue process, try to answer the
following questions.
Don't worry if they're not all applicable; just try to include what you can
:-)
If you need to include code snippets or logs, please put them in fenced code
blocks. If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>
Please delete these comment blocks before submitting the issue.
-->
<!--
IMPORTANT!!!
PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
Please complete the next sections or the issue will be closed.
These questions are the first thing we need to know to understand the
context.
-->
**Apache Airflow version**: 2.1.0
**apache-airflow-providers-google**: 4.0.0rc1
**What happened**:
<!-- (please include exact error messages if you can) -->
```python
t1 = GCSToBigQueryOperator(
task_id='ingest_data',
bucket='harry-airflow-dev',
source_objects=['log_raw_data_0'],
source_format='PARQUET',
destination_project_dataset_table=f"{DATASET_NAME}.{TABLE_NAME}",
write_disposition='WRITE_TRUNCATE'
)
```
**error messages**:
```log
Traceback (most recent call last):
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1137, in _run_raw_task
self._prepare_and_execute_task_with_callbacks(context, task)
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1311, in _prepare_and_execute_task_with_callbacks
result = self._execute_task(context, task_copy)
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1341, in _execute_task
result = task_copy.execute(context=context)
File "/home/harry/airflow/plugins/operators/gcs_to_bq.py", line 107, in
execute
cursor.run_load(
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/hooks/bigquery.py",
line 2688, in run_load
return self.hook.run_load(*args, **kwargs)
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/hooks/bigquery.py",
line 1921, in run_load
job = self.insert_job(configuration=configuration,
project_id=self.project_id)
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/providers/google/common/hooks/base_google.py",
line 425, in inner_wrapper
return func(self, *args, **kwargs)
File
"/home/harry/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/hooks/bigquery.py",
line 1641, in insert_job
job.result()
File
"/home/harry/.local/lib/python3.8/site-packages/google/cloud/bigquery/job/base.py",
line 679, in result
return super(_AsyncJob, self).result(timeout=timeout, **kwargs)
File
"/home/harry/.local/lib/python3.8/site-packages/google/api_core/future/polling.py",
line 134, in result
raise self._exception
google.api_core.exceptions.Conflict: 409 Already Exists: Table
bigdata-dev-287803:z_harry_test.gcs_to_bq_table
```
**What you expected to happen**:
As the document said, using `WRITE_TRUNCATE ` should erase the data and the
schema in the existing table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]