import org.apache.spark.rdd.NewHadoopRDD import org.apache.hadoop.hbase.mapreduce.TableInputFormat import org.apache.hadoop.hbase.HBaseConfiguration import org.apache.hadoop.hbase.client.Result val sparkContext = new SparkContext("local", "Simple App") val hbaseConfiguration = (hbaseConfigFileName: String, tableName: String) => { val hbaseConfiguration = HBaseConfiguration.create() hbaseConfiguration.addResource(hbaseConfigFileName) hbaseConfiguration.set(TableInputFormat.INPUT_TABLE, tableName) hbaseConfiguration } val rdd = new NewHadoopRDD( sparkContext, classOf[TableInputFormat], classOf[ImmutableBytesWritable], classOf[Result], hbaseConfiguration("/path/to/hbase-site.xml", "table-with-data") )