VZLA
Databricks Employee
Databricks Employee

@soumiknow ,

Just checking if there are any further questions, and did my last comment help?

soumiknow
Databricks Partner

Issue got resolved with DRB 16.1. Many thanks to Support Team.

View solution in original post

ambar2595
New Contributor III

I'm using DBR 16.3 and all partitions are still being deleted. This is the code I'm using. No success. 

 

spark = (
        SparkSession.builder.config("spark.datasource.bigquery.intermediateFormat", "orc")
        .config("spark.sql.sources.partitionOverwriteMode", "dynamic")
        .getOrCreate()
    )
visiting_client_day = (
        spark.read.format("delta")
        .load("s3://bucket-2/gold/visiting_client_day")
        .where(col("date_utc") == lit("2025-05-04"))
    )
(
        visiting_client_day.write.format("bigquery")
        .option("parentProject", "parentProject")
        .option("project", "project")
        .option("temporaryGcsBucket", "bucket")
        .mode("overwrite")
        .option("table", FINAL_TABLE)
        .save()
    )

 

 

soumiknow
Databricks Partner

Hi @ambar2595 ,

Please could you try adding 'writeMedthod' option with 'indirect' value.

option("writeMethod", "indirect")

 

ambar2595
New Contributor III

According to the documentation, this is the default value. https://github.com/GoogleCloudDataproc/spark-bigquery-connector/blob/master/README.md

ambar2595_0-1746521270975.png

and I just tried it and it didn't work. 😞

 

soumiknow
Databricks Partner

Yes, agreed. Give it a try for once. If not worked, then this issue introduced with DBR 16.3. Earlier DBR 15.4 LTS had the issue which got fixed in DBR 16.1.

ambar2595
New Contributor III

It didn't worked with DBR 16.1 as well. 

soumiknow
Databricks Partner

I am still using DBR 16.1 and the partitionOverwriteMode with 'DYNAMIC' value is working for me. Today itself I rechecked the workflow.