DAY partitioned BQ table data deleted fully even though 'spark.sql.sources.partitionOverwriteMode' is DYNAMIC #1325
Labels
waiting for information
Waiting for additional information from the issue opener
We have a date (YYYY-MM-DD) partitioned BQ table where it partitioned by DAY. We want to update a specific partition data in 'overwrite' mode using PySpark. So to do this, I applied 'spark.sql.sources.partitionOverwriteMode' to 'DYNAMIC' as per the spark-bigquery-connector documentation. But still it deleted the other partitioned data which should not be happening.
To give more context:
df.write.format("bigquery") \ .option("table", f"{bq_table}") \ .option("dataset", f"{bq_dataset}") \ .option("temporaryGcsBucket", f"{temp_gcs_bucket}") \ .option("partitionField", f"{partition_date_col}") \ .option("partitionType", f"{bq_partition_type}") \ .option("spark.sql.sources.partitionOverwriteMode", "DYNAMIC") \ .option("writeMethod", "indirect") \ .mode("overwrite") \ .save()
Databricks Runtime Version: 15.4 LTS (includes Apache Spark 3.5.0, Scala 2.12)
The text was updated successfully, but these errors were encountered: