Reputation: 560
I am pretty new in bigquery. I have created bigquery table from gcp console where GCS CSV file is used as data source. I think when i delete any row, that should also be deleted from GCS file. But practically it's not happening.
Upvotes: 0
Views: 1516
Reputation: 4085
As you can see in the image below, BigQuery
supports three types of tables: Native, External and Views
When you create a Native Table, your data is fully imported into BigQuery
's storage system and transformed in order to be optimized for queries.
An External Table is basically a pointer to your source files. In other words, every time you run a query against an External Table, BigQuery
access the original source of data (some file in GCS, Google Driver, etc..)
Given that, I can go directly to your question: BigQuery will not update the source files when you run some DML statement. If you run a DML statement (DELETE, UPDATE) against a Native table, the data inside BigQuery's storage system will be changed but the files will not be touched.
Also, DML is not supported in External Tables. If you try to run a DELETE statement agains an External Table for example you will get an error: DML over table 'project.dataset.table' is not supported.
I strongly recommend that you take a look in this documentation
Upvotes: 1
Reputation: 76053
When you use BigQuery, you have 2 ways to load data from GCS CSV file.
In this case, it's normal that the file doesn't change when you delete data into BigQuery
Workaround
As workaround, your can use the solution 1:
Upvotes: 1