title: Spark: Mapping an RDD of HBase row keys to an RDD of values
body: <p>I have an RDD that contains HBase row keys. The RDD is relatively large to fit in memory. I need to get an RDD of values for each of the provided key. Is there a way to do something like this:</p>
  
  <pre><code>keys.map(key =&gt; table.get(new Get(key)))
  </code></pre>
  
  <p>So the question is how can I obtain an instance of HTable inside map task? Should I instantiate an HConnection for every partition, and then obtain HTable instance from it, or is there a better way?</p>