<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark Hbase Connector NullPointerException in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170927#M133224</link>
    <description>&lt;P&gt;I guess your code is the old one. The latest code does not has this issue. Currently, SHC has the default table coder "Phoenix", but it has incompatibility issue. We are working on the &lt;A href="https://github.com/hortonworks-spark/shc/pull/95"&gt;PR#95&lt;/A&gt; to fix it. In SHC we have release tags for each branch (e.g. Tag &lt;A href="https://github.com/hortonworks-spark/shc/tree/v1.0.1-2.0"&gt;v1.0.1-2.0 &lt;/A&gt;for Spark v2.0 and &lt;A href="https://github.com/hortonworks-spark/shc/tree/v1.0.1-1.6"&gt;v1.0.1-1.6&lt;/A&gt; for Spark v1.6) that show the snapshots that should be used, as opposed to branch heads that might be unstable. &lt;/P&gt;</description>
    <pubDate>Sat, 18 Feb 2017 04:05:04 GMT</pubDate>
    <dc:creator>wyang</dc:creator>
    <dc:date>2017-02-18T04:05:04Z</dc:date>
    <item>
      <title>Spark Hbase Connector NullPointerException</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170924#M133221</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm trying to connect to HBase from Spark using this connector &lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hortonworks-spark/shc" target="_blank"&gt;https://github.com/hortonworks-spark/shc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;PRE&gt;def catalog = s"""{
                  |"table":{"namespace":"default", "name":"terminals"},
                  |"rowkey":"key",
                  |"columns":{
                  |"col0":{"cf":"rowkey", "col":"key", "type":"string"},
                  |"col1":{"cf":"tinfo", "col":"status", "type":"int"},
                  |"col2":{"cf":"tinfo", "col":"latitude", "type":"double"},
                  |"col2":{"cf":"tinfo", "col":"longitude", "type":"double"}
                  |}
                  |}""".stripMargin

def withCatalog(cat: String): DataFrame = {
  sqlContext
    .read
    .options(Map(HBaseTableCatalog.tableCatalog-&amp;gt;cat))
    .format("org.apache.spark.sql.execution.datasources.hbase")
    .load()
}

val df = withCatalog(catalog)
df.show()
val dfFilter = df.filter($"col0".isin("1212121"))
parsed.join(dfFilter, parsed("terminal_id") === dfFilter("col0")).show()&lt;/PRE&gt;&lt;P&gt;but when I try to execute with spark-submit:&lt;/P&gt;&lt;PRE&gt;spark-submit --class com.location.userTransactionMain --master local[*] --files /etc/hbase/conf/hbase-site.xml userTransactionAppScala-assembly-1.0.jar&lt;/PRE&gt;&lt;P&gt;It returns an error:&lt;/P&gt;&lt;P&gt;
&lt;EM&gt;Exception in thread "main" java.lang.NullPointerException: Please define 'tableCoder' in your catalog. If there is an Avro records/schema in your catalog, please explicitly define 'coder' in its corresponding column.
  at org.apache.spark.sql.execution.datasources.hbase.HBaseTableCatalog$.apply(HBaseTableCatalog.scala:223)
  at org.apache.spark.sql.execution.datasources.hbase.HBaseRelation.&amp;lt;init&amp;gt;(HBaseRelation.scala:77)
  at org.apache.spark.sql.execution.datasources.hbase.DefaultSource.createRelation(HBaseRelation.scala:51)
  at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;Thanks!!!!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 21:00:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170924#M133221</guid>
      <dc:creator>masfworld</dc:creator>
      <dc:date>2017-02-11T21:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Hbase Connector NullPointerException</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170925#M133222</link>
      <description>&lt;P&gt;There is a "tableCoder" required in the table definition in catalog. Please refer to this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/hortonworks-spark/shc/blob/master/examples/src/main/scala/org/apache/spark/sql/execution/datasources/hbase/Catalog.scala" target="_blank"&gt;https://github.com/hortonworks-spark/shc/blob/master/examples/src/main/scala/org/apache/spark/sql/execution/datasources/hbase/Catalog.scala&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 10:22:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170925#M133222</guid>
      <dc:creator>vjiang</dc:creator>
      <dc:date>2017-02-13T10:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Hbase Connector NullPointerException</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170926#M133223</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Please copy hbase-site.xml file to /etc/spark/conf and retry ,let me know how it went.&lt;/P&gt;&lt;P&gt;And also refer below article&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/content/supportkb/48988/how-to-run-spark-job-to-interact-with-secured-hbas.html" target="_blank"&gt;https://community.hortonworks.com/content/supportkb/48988/how-to-run-spark-job-to-interact-with-secured-hbas.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 11:25:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170926#M133223</guid>
      <dc:creator>reddyr211</dc:creator>
      <dc:date>2017-02-16T11:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Hbase Connector NullPointerException</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170927#M133224</link>
      <description>&lt;P&gt;I guess your code is the old one. The latest code does not has this issue. Currently, SHC has the default table coder "Phoenix", but it has incompatibility issue. We are working on the &lt;A href="https://github.com/hortonworks-spark/shc/pull/95"&gt;PR#95&lt;/A&gt; to fix it. In SHC we have release tags for each branch (e.g. Tag &lt;A href="https://github.com/hortonworks-spark/shc/tree/v1.0.1-2.0"&gt;v1.0.1-2.0 &lt;/A&gt;for Spark v2.0 and &lt;A href="https://github.com/hortonworks-spark/shc/tree/v1.0.1-1.6"&gt;v1.0.1-1.6&lt;/A&gt; for Spark v1.6) that show the snapshots that should be used, as opposed to branch heads that might be unstable. &lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 04:05:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-Hbase-Connector-NullPointerException/m-p/170927#M133224</guid>
      <dc:creator>wyang</dc:creator>
      <dc:date>2017-02-18T04:05:04Z</dc:date>
    </item>
  </channel>
</rss>

