<?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 pyspark dropDuplicates performance issue in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/59886#M31519</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to delete duplicate records found by key but its very slow.&amp;nbsp; Its continuous running pipeline so data is not that huge but still it takes time to execute this command.&lt;/P&gt;&lt;P&gt;df = df.dropDuplicates(&lt;SPAN&gt;["fileName"])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any better approach to delete duplicate data from pyspark dataframe.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 05:26:16 GMT</pubDate>
    <dc:creator>sanjay</dc:creator>
    <dc:date>2024-02-12T05:26:16Z</dc:date>
    <item>
      <title>pyspark dropDuplicates performance issue</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/59886#M31519</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to delete duplicate records found by key but its very slow.&amp;nbsp; Its continuous running pipeline so data is not that huge but still it takes time to execute this command.&lt;/P&gt;&lt;P&gt;df = df.dropDuplicates(&lt;SPAN&gt;["fileName"])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any better approach to delete duplicate data from pyspark dataframe.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 05:26:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/59886#M31519</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-02-12T05:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: pyspark dropDuplicates performance issue</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/59900#M31527</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;. As I am trying to remove duplicate only on single column, so am specifying column name in dropDuplicates. Still its very slow. Can you provide more context on last point i.e.&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Streamlining Your Data with Grouping and Aggregation: To easily condense your dataset by a single column's values, utilize the power of aggregation functions.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Is there any possibility to tune dropDuplicate&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Feb 2024 08:47:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/59900#M31527</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-02-12T08:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: pyspark dropDuplicates performance issue</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/108270#M43013</link>
      <description>&lt;P&gt;Before dropDuplicates eensure that your DataFrame operations are optimized by caching intermediate results if they are reused multiple times. This can help reduce the overall execution time.&lt;/P&gt;
&lt;P&gt;We could use some aggregates and grouping like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;df_deduped = df.groupBy("fileName").agg(first("fileName").alias("fileName"))&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 01 Feb 2025 07:19:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-dropduplicates-performance-issue/m-p/108270#M43013</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2025-02-01T07:19:04Z</dc:date>
    </item>
  </channel>
</rss>

