cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

OutputMode “complete” unable to replace the entire table

guangyi
Contributor III

According to the document https://docs.databricks.com/en/structured-streaming/delta-lake.html#complete-mode, the “complete” option seems to “replace the entire table with every batch”. However, it is not working in my case.

Here is how I reproduce the issue:

Firstly I prepared a single file in the ADLS named `employee_01.csv`. Then I use the python code to read data from it and generate a table

 

 

outputMode = 'complete'

default_spark_options = {
    "cloudFiles.format": "csv",
    "delimiter": "\x01",
    "inferSchema": "true"
}

    @Dlt.table(
        name = table_01,
    )
    def create_raw_table():
        path = source_path
        df = (spark.readStream
            .outputMode(outputMode)
            .format("cloudFiles")
            .options(**spark_options)
            .load(path))
        return df

 

 

 

I can load the data and create the table successfully

Then I upload another file in the ADLS and trigger the DLT pipeline again.

However, when the DLT pipeline finished running. The table result seems contains the two running result together

Do I understanding the `complete` outputMode incorrectly

1 REPLY 1

guangyi
Contributor III

I figure out it already. I cannot find the delete button. Please ignore this post

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group