Using - hbase_connectors- hbase-spark.jar results in following exception -
23/02/07 12:29:58 Driver-Driverid ERROR ApplicationMaster: User class threw exception: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.hadoop.hbase.spark.HBaseRelation.<init>(DefaultSource.scala:138)
at org.apache.hadoop.hbase.spark.DefaultSource.createRelation(DefaultSource.scala:78)
at org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand.run(SaveIntoDataSourceCommand.scala:45)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:70)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:68)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:86)
To resolve this error, set -
- hbase.spark.use.hbasecontext to false
Example -
personDS.write.format("org.apache.hadoop.hbase.spark").
option("hbase.columns.mapping", "name STRING :key, email STRING c:email, " +
"birthDate DATE p:birthDate, height FLOAT p:height").
option("hbase.table", "person").option("hbase.spark.use.hbasecontext", false).save()
Refer - https://community.cloudera.com/t5/Community-Articles/HBase-Spark-in-CDP/ta-p/294868
Comments
Post a Comment