title: Read a hbase table using spark
body: <p>I have a table "Gazelle" with 216 columns, and i want to get some of their columns in a javaPairRDD. 
  I've tried to follow this link :</p>
  
  <p><a href="https://stackoverflow.com/questions/25040709/how-to-read-from-hbase-using-spark">How to read from hbase using spark</a>
  and this one : <a href="https://stackoverflow.com/questions/24534410/how-to-fetch-all-of-data-from-hbase-table-in-spark">how to fetch all of data from hbase table in spark</a></p>
  
  <p>In order to import all jars i need i've added this dependency to my pom file : </p>
  
  <pre><code>'&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4.0.0</p>
  
  <pre><code>&lt;groupId&gt;fr.aid.cim&lt;/groupId&gt;
  &lt;artifactId&gt;spark-poc&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
          &lt;artifactId&gt;spark-core_2.10&lt;/artifactId&gt;
          &lt;version&gt;1.1.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hbase&lt;/groupId&gt;
          &lt;artifactId&gt;hbase-client&lt;/artifactId&gt;
          &lt;version&gt;0.96.0-hadoop2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hbase&lt;/groupId&gt;
          &lt;artifactId&gt;hbase&lt;/artifactId&gt;
          &lt;version&gt;0.20.6&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
  &lt;/project&gt;'    
  </code></pre>
  
  <p>and this is my code : </p>
  
  <pre><code>'SparkConf sparkConf = new SparkConf().setAppName("JavaWordCount");
      JavaSparkContext ctx = new JavaSparkContext(sparkConf);
      //JavaSQLContext jsql = new JavaSQLContext(sc);
      //test hbase table
      HBaseConfiguration conf = new HBaseConfiguration();
      conf.set("hbase.zookeeper.quorum", "192.168.10.32");
      conf.set("hbase.zookeeper.property.clientPort","2181");
      conf.set("hbase.master", "192.168.10.32" + ":60000");
      conf.set("hbase.cluster.distributed", "true");
      conf.set("hbase.rootdir", "hdfs://localhost:8020/hbase");
  
      //conf.set(TableInputFormat.INPUT_TABLE, "gazelle_hive4");
      String tableName = "gazelle_hbase4";
      HTable table = new HTable(conf,tableName);
      JavaPairRDD&lt;ImmutableBytesWritable, Result&gt; hBaseRDD = ctx
              .newAPIHadoopRDD(
                      conf,
                      TableInputFormat.class,,
                      org.apache.hadoop.hbase.io.ImmutableBytesWritable.class,
                      org.apache.hadoop.hbase.client.Result.class);
      hBaseRDD.coalesce(1, true).saveAsTextFile(path + "hBaseRDD");'
  </code></pre>
  
  <p>But i have a problem with "TableInputFormat" </p>
  
  <blockquote>
    <p>Error : Cannot resolve symbol TableInputFormat. 
    Is their another library i should import or another dependency i should add? </p>
  </blockquote>
  
  <p>Note: I haven't created any XML file. 
  Should i create the "hbase-default.xml" and "hbase-site.xml" ? If yes, how ?</p>
  
  <p>Thank you in advance for your help.</p>