<?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 Issue with merge command between streaming dataframe and delta table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/issue-with-merge-command-between-streaming-dataframe-and-delta/m-p/50512#M28821</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are trying to build and upsert logic for a Delta table for that we are writing a merge command between streaming dataframe and delta table dataframe. Please find the below code&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; merge_sql = &lt;/SPAN&gt;&lt;SPAN&gt;f"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Merge command come here&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spark.sql(merge_sql).writeStream \&lt;BR /&gt;.format("delta") \&lt;BR /&gt;.outputMode("append") \&lt;BR /&gt;.option("checkpointLocation", "bbbbb") \&lt;BR /&gt;.option("mergeSchema", "true") \&lt;BR /&gt;.option("path","aaaaaaa") \&lt;BR /&gt;.toTable(f"{target_catalog}.{target_schema}.silver_{sl_tablename}")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getting this below error. Please help us on how to resolve this error.&lt;BR /&gt;Error during merge operation on 'tablename': Queries with streaming sources must be executed with writeStream.start();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 06 Nov 2023 12:55:03 GMT</pubDate>
    <dc:creator>Venu_DE1</dc:creator>
    <dc:date>2023-11-06T12:55:03Z</dc:date>
    <item>
      <title>Issue with merge command between streaming dataframe and delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-with-merge-command-between-streaming-dataframe-and-delta/m-p/50512#M28821</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are trying to build and upsert logic for a Delta table for that we are writing a merge command between streaming dataframe and delta table dataframe. Please find the below code&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; merge_sql = &lt;/SPAN&gt;&lt;SPAN&gt;f"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Merge command come here&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spark.sql(merge_sql).writeStream \&lt;BR /&gt;.format("delta") \&lt;BR /&gt;.outputMode("append") \&lt;BR /&gt;.option("checkpointLocation", "bbbbb") \&lt;BR /&gt;.option("mergeSchema", "true") \&lt;BR /&gt;.option("path","aaaaaaa") \&lt;BR /&gt;.toTable(f"{target_catalog}.{target_schema}.silver_{sl_tablename}")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;getting this below error. Please help us on how to resolve this error.&lt;BR /&gt;Error during merge operation on 'tablename': Queries with streaming sources must be executed with writeStream.start();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Nov 2023 12:55:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-with-merge-command-between-streaming-dataframe-and-delta/m-p/50512#M28821</guid>
      <dc:creator>Venu_DE1</dc:creator>
      <dc:date>2023-11-06T12:55:03Z</dc:date>
    </item>
  </channel>
</rss>

