title: How do I remove duplicate rows from a table on the basis of Primary keys?
body: <p>I have a Table loaded in Dataframe and I tried to use groupBy with PKs.</p>
  <pre><code>df_remitInsert = spark.sql(&quot;&quot;&quot;SELECT * FROM trac_analytics.mainremitdata&quot;&quot;&quot;)
  df_remitInsert_filter = df_remitInsert.groupBy(&quot;LoanID_Serv&quot;, &quot;LoanNumber&quot;, &quot;Month&quot;).count().filter(&quot;count &gt; 1&quot;).drop('count')
  </code></pre>
  <p>where, <code>&quot;LoanID_Serv&quot;, &quot;LoanNumber&quot;, &quot;Month&quot;</code> are my Primary Keys.</p>
  <p>I want to achieve entire data from <code>df_remitInsert</code> which are deduplicated w.r.t Primary Keys.</p>