PHOENIX SPARK - Load Table as DataFrame
<p>I have created a DataFrame from a HBase Table (PHOENIX) which has 500 million rows. From the DataFrame I created an RDD of JavaBean and use it for joining with data from a file.</p>

<pre><code>Map&lt;String, String&gt; phoenixInfoMap = new HashMap&lt;String, String&gt;();
phoenixInfoMap.put("table", tableName);
phoenixInfoMap.put("zkUrl", zkURL);
DataFrame df = sqlContext.read().format("org.apache.phoenix.spark").options(phoenixInfoMap).load();
JavaRDD&lt;Row&gt; tableRows = df.toJavaRDD();
JavaPairRDD&lt;String, AccountModel&gt; dbData = tableRows.mapToPair(
new PairFunction&lt;Row, String, String&gt;()
{
    @Override
    public Tuple2&lt;String, String&gt; call(Row row) throws Exception
    {
        return new Tuple2&lt;String, String&gt;(row.getAs("ID"), row.getAs("NAME"));
    }
});
</code></pre>

<p>Now my question - Lets say the file has 2 unique million entries matching with the table. Is the entire table loaded into memory as RDD or only the matching 2 million records from the table will be loaded into memory as RDD ?</p>