<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tring to create incremental pipeline but fails when I try to use outputMode &amp;quot;update&amp;quot; in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31348#M22808</link>
    <description>&lt;P&gt;I tried with the both ways&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 18:32:00 GMT</pubDate>
    <dc:creator>BorislavBlagoev</dc:creator>
    <dc:date>2022-01-19T18:32:00Z</dc:date>
    <item>
      <title>Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31344#M22804</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;def upsertToDelta(microBatchOutputDF, batchId): 
  
  microBatchOutputDF.createOrReplaceTempView("updates")
&amp;nbsp;
  microBatchOutputDF._jdf.sparkSession().sql("""
    MERGE INTO old o
    USING updates u
    ON u.id = o.id
    WHEN MATCHED THEN UPDATE SET *
    WHEN NOT MATCHED THEN INSERT *
  """)
&amp;nbsp;
stream_new_df = spark.readStream.format("delta").load(new_data_frame_path)
stream_old_df = spark.readStream.format("delta").load(old_data_frame_path)
&amp;nbsp;
stream_old_df.createOrReplaceTempView("old")
&amp;nbsp;
stream_new_df.writeStream.format("delta") \
            .option("checkpointLocation", "") \
            .option("mergeSchema", "true") \
            .option("path", "") \
            .foreachBatch(upsertToDelta) \
            .trigger(once=True) \
            .outputMode("update") \
            .table("")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm trying to execute this code but I get the following error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Data source com.databricks.sql.transaction.tahoe.sources.DeltaDataSource does not support Update output mode&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 17:27:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31344#M22804</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-19T17:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31345#M22805</link>
      <description>&lt;P&gt;Delta table/file version is too old. Please try to upgrade it as described  here &lt;A href="https://docs.microsoft.com/en-us/azure/databricks/delta/versioning​" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/delta/versioning​&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 17:52:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31345#M22805</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-01-19T17:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31346#M22806</link>
      <description>&lt;P&gt;Which is the latest version?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 17:56:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31346#M22806</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-19T17:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31347#M22807</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;I get the same error &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AnalysisException: Data source com.databricks.sql.transaction.tahoe.sources.DeltaDataSource does not support Update output mode&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 18:20:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31347#M22807</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-19T18:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31348#M22808</link>
      <description>&lt;P&gt;I tried with the both ways&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 18:32:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31348#M22808</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-19T18:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31349#M22809</link>
      <description>&lt;P&gt;Did it work? Databricks runtime is also imported as older one (like one used by data factory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can also refactor code a bit to use .start() in last line not .table() and change a bit def upsertToDelta to just use something like that (it is in scala but similar logic for python) &lt;A href="https://docs.databricks.com/_static/notebooks/merge-in-streaming.html" target="test_blank"&gt;https://docs.databricks.com/_static/notebooks/merge-in-streaming.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 10:38:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31349#M22809</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-01-20T10:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31350#M22810</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp; The runtime version is 9.1LTS. And I want to use the `.table()` because I want to have a table in my metastore/catalog&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 10:42:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31350#M22810</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-20T10:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31351#M22811</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp; I also tried with 10.2 runtime and with toTable() but it's the same&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 11:06:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31351#M22811</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-20T11:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31352#M22812</link>
      <description>&lt;P&gt;to have table in metastore just register your delta location there using seperate sql script (it is enough to do that one time):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%sql
CREATE TABLE IF NOT EXISTS your_db.your_table
( 
 id LONG NOT NULL COMMENT,
 ......
)
USING DELTA
PARTITIONED BY (partition_column)
LOCATION 'path_to_your_delta'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 11:54:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31352#M22812</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-01-20T11:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Tring to create incremental pipeline but fails when I try to use outputMode "update"</title>
      <link>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31353#M22813</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;It works like that. I have one more question. How can I include and delete that query?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  microBatchOutputDF._jdf.sparkSession().sql("""
    MERGE INTO old o
    USING updates u
    ON u.id= o.id
    WHEN MATCHED THEN UPDATE SET *
    WHEN NOT MATCHED THEN INSERT *
  """)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or how I can add and delete rows from this pipeline.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 14:11:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/tring-to-create-incremental-pipeline-but-fails-when-i-try-to-use/m-p/31353#M22813</guid>
      <dc:creator>BorislavBlagoev</dc:creator>
      <dc:date>2022-01-20T14:11:44Z</dc:date>
    </item>
  </channel>
</rss>

