<?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: Duplicate rows when Full load notebook runs in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4026527#M4416</link>
    <description>&lt;P&gt;I have created the ticket withsupport as suggested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2406170050002527&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 07:37:33 GMT</pubDate>
    <dc:creator>nikhil0511</dc:creator>
    <dc:date>2024-07-05T07:37:33Z</dc:date>
    <item>
      <title>Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3991671#M3952</link>
      <description>&lt;P&gt;Hello Forum,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table - named OINV ingested from SAP to Bronze layer lakehouse via a dataflow. I would like to ingest this table from Bronze to Silver lakehouse with the following code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 1&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%%&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DROP&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt; &lt;SPAN&gt;EXISTS&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;OINV&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cell 2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Load initially full OINV from Bronze to Silver&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; pyspark.sql.types &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; *&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;source_table_name = &lt;/SPAN&gt;&lt;SPAN&gt;'OINV'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;target_table_name = &lt;/SPAN&gt;&lt;SPAN&gt;'OINV_new'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;OINV_df = spark.read.parquet(&lt;/SPAN&gt;&lt;SPAN&gt;'Files/'&lt;/SPAN&gt;&lt;SPAN&gt; + source_table_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;OINV_df\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .write\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .mode(&lt;/SPAN&gt;&lt;SPAN&gt;'overwrite'&lt;/SPAN&gt;&lt;SPAN&gt;)\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .format(&lt;/SPAN&gt;&lt;SPAN&gt;'delta'&lt;/SPAN&gt;&lt;SPAN&gt;)\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .save(&lt;/SPAN&gt;&lt;SPAN&gt;'Tables/'&lt;/SPAN&gt;&lt;SPAN&gt; + target_table_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;At the initial run, when the dataflow refresh completes, the table is created in bronze layer. I have created a shortcut in silver lakehouse before running the notebook. In the first run the number of rows in both the tables are same. When I run the code second time, the number of rows muliplies by 2 or sometimes 3. Interesting thing is when I run further the same code, the rows count is same. This happens only when I run the code the second time.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Not only this is happening in same workspace but for all the workspaces in our tenant.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please help us in fixing this.&lt;/DIV&gt;&lt;DIV&gt;Thank you&lt;/DIV&gt;&lt;DIV&gt;Nikhi&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jun 2024 17:42:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3991671#M3952</guid>
      <dc:creator>nikhil0511</dc:creator>
      <dc:date>2024-06-13T17:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3993296#M3985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305943" data-lia-user-login="nikhil0511" class="lia-mention lia-mention-user"&gt;nikhil0511&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for using Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;It seems like you are experiencing an issue where the number of rows in your table multiplies after the second run of your code. Here are few possible reasons that might help you.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Duplication:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If your data source (in this case, the ‘OINV’ table in the Bronze layer) is being updated between your runs, and the new data includes rows that were already present in the previous data, this could lead to duplication when you overwrite the Silver layer table.&lt;/LI&gt;
&lt;LI&gt;Ensure that the ‘OINV’ table in the Bronze layer isn’t being updated with duplicate rows between your runs.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Caching Issues:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Spark, the processing engine you are using, caches data for performance optimization. Sometimes, this can lead to unexpected results if the cache isn’t invalidated properly.&lt;/LI&gt;
&lt;LI&gt;Before running your code, you can clear the Spark cache to ensure that you are working with the most recent data. You can do this by calling spark.catalog.clearCache()&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If the issue still persists, please do let us know. Glad to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this information helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 12:06:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3993296#M3985</guid>
      <dc:creator>v-cboorla-msft</dc:creator>
      <dc:date>2024-06-14T12:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3993529#M3989</link>
      <description>&lt;P&gt;Hello V-cboorla-msft,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are indeed using the clear cache code for one of our tables from Bronze to silver.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;# Step 1: Unpersist the DataFrame if it is cached&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;'epages_web_stores_df'&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;locals&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;SPAN&gt;or&lt;/SPAN&gt; &lt;SPAN&gt;'epages_web_stores_df'&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;globals&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; epages_web_stores_df.unpersist()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# Step 2: Set the DataFrame variable to None&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;epages_web_stores_df = &lt;/SPAN&gt;&lt;SPAN&gt;None&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Even after using this and use the same code that overwrites the table data, we are still seeing the entire table with duplicate rows. The number of rows simply double. Even in the first run.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:23:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3993529#M3989</guid>
      <dc:creator>nikhil0511</dc:creator>
      <dc:date>2024-06-14T14:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3995924#M4007</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;V-cboorla-msft,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Today I have used the following code to run and see if there is a chance the number of rows doesn't double, after your advice.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spark.catalog.clearCache()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%%&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DROP&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt; &lt;SPAN&gt;EXISTS&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;OINV&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#Load initially full OINV from Bronze to Silver&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; pyspark.sql.types &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; *&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;source_table_name = &lt;/SPAN&gt;&lt;SPAN&gt;'OINV'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;target_table_name = &lt;/SPAN&gt;&lt;SPAN&gt;'OINV_new'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;OINV_df = spark.read.parquet(&lt;/SPAN&gt;&lt;SPAN&gt;'Files/'&lt;/SPAN&gt;&lt;SPAN&gt; + source_table_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;OINV_df\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .write\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .mode(&lt;/SPAN&gt;&lt;SPAN&gt;'overwrite'&lt;/SPAN&gt;&lt;SPAN&gt;)\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .format(&lt;/SPAN&gt;&lt;SPAN&gt;'delta'&lt;/SPAN&gt;&lt;SPAN&gt;)\&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; .save(&lt;/SPAN&gt;&lt;SPAN&gt;'Tables/'&lt;/SPAN&gt;&lt;SPAN&gt; + target_table_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df = spark.sql("&lt;/SPAN&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; * &lt;/SPAN&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; DE_LH_200_SILVER_MarketingDocuments.OINV")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df.count()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;I have deleted the Tables in Bronze lakehouse that was created by the dataflow. Re-run the dataflow and executed the above Notebook cells. Initially I have 657966 rows. After refreshing the dataflow second time and executing the notebook, the result is 1315948.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Seems the caching step and table deletion step is not useful.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please note I am connecting the tables from the Brone layer as shortcut in Files/OINV.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 10:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/3995924#M4007</guid>
      <dc:creator>nikhil0511</dc:creator>
      <dc:date>2024-06-17T10:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4004462#M4130</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305943" data-lia-user-login="nikhil0511" class="lia-mention lia-mention-user"&gt;nikhil0511&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies for the inconvenience.&lt;/P&gt;
&lt;P&gt;Please reach out to our support team to gain deeper insights and explore potential solutions. It's highly recommended that you reach out to our support team. Their expertise will be invaluable in suggesting the most appropriate approach.&lt;/P&gt;
&lt;P&gt;Please go ahead and raise a support ticket to reach our support team:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.fabric.microsoft.com/support" target="_blank"&gt;https://support.fabric.microsoft.com/support&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After creating a Support ticket please provide the ticket number as it would help us to track for more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 16:43:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4004462#M4130</guid>
      <dc:creator>v-cboorla-msft</dc:creator>
      <dc:date>2024-06-21T16:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4006161#M4141</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305943" data-lia-user-login="nikhil0511" class="lia-mention lia-mention-user"&gt;nikhil0511&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We haven’t heard from you on the last response and was just checking back to see if you've had a chance to submit a support ticket. If you have, a reference to the ticket number would be greatly appreciated. This will allow us to track the progress of your request and ensure you receive the most efficient support possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 05:09:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4006161#M4141</guid>
      <dc:creator>v-cboorla-msft</dc:creator>
      <dc:date>2024-06-24T05:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rows when Full load notebook runs</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4026527#M4416</link>
      <description>&lt;P&gt;I have created the ticket withsupport as suggested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2406170050002527&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 07:37:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Duplicate-rows-when-Full-load-notebook-runs/m-p/4026527#M4416</guid>
      <dc:creator>nikhil0511</dc:creator>
      <dc:date>2024-07-05T07:37:33Z</dc:date>
    </item>
  </channel>
</rss>

