How to divide dataset in two parts based on filter in Spark-scala
<p>Is it possible to divide DF in two parts using single filter operation.For example</p>

<p>let say df has below records</p>

<pre><code>UID    Col
 1       a
 2       b
 3       c
</code></pre>

<p>if I do </p>

<pre><code>df1 = df.filter(UID &lt;=&gt; 2)
</code></pre>

<p>can I save filtered and non-filtered records in different RDD in single operation
? </p>

<pre><code> df1 can have records where uid = 2
 df2 can have records with uid 1 and 3 
</code></pre>