hive-hbase integration throws classnotfoundexception NULL::character varying -
following link https://cwiki.apache.org/confluence/display/hive/hbaseintegration#hbaseintegration-hivemaptohbasecolumnfamily
i'm trying integrate hive , hbase, have configuration in hive-site.xml:
<property> <name>hive.aux.jars.path</name> <value> file:///$hive_home/lib/hive-hbase-handler-2.0.0.jar, file:///$hive_home/lib/hive-ant-2.0.0.jar, file:///$hive_home/lib/protobuf-java-2.5.0.jar, file:///$hive_home/lib/hbase-client-1.1.1.jar, file:///$hive_home/lib/hbase-common-1.1.1.jar, file:///$hive_home/lib/zookeeper-3.4.6.jar, file:///$hive_home/lib/guava-14.0.1.jar </value> </property>
then create table named 'ts:testtable' in hbase:
hbase> create 'ts:testtable','pokes' hbase> put 'ts:testtable', '10000', 'pokes:value','val_10000' hbase> put 'ts:testtable', '10001', 'pokes:value','val_10001' ... hbase> scan 'ts:testtable' row column+cell 10000 column=pokes:value, timestamp=1462782972084, value=val_10000 10001 column=pokes:value, timestamp=1462783514212, value=val_10001 ....
and create external table in hive:
hive> create external table hbase_test_table(key int, value string ) stored 'org.apache.hadoop.hive.hbase.hbasestoragehandler' serdeproperties ("hbase.columns.mapping" = ":key, pokes:value") tblproperties ("hbase.table.name" = "ts:testtable", "hbase.mapred.output.outputtable" = "ts:testtable");
so far good. when tried select data test table, exception thrown:
hive> select * hbase_test_table; failed: runtimeexception java.lang.classnotfoundexception: null::character varying error: error while compiling statement: failed: runtimeexception java.lang.classnotfoundexception: null::character varying (state=42000,code=40000)
am missing anything?
i'm trying hive 2.0.0 around hbase 1.2.1
ok, figured out, "null::character varying" not part of hive, coming postgresql, i'm using end of metastore. problem hive doesn't recognizes exception postgresql. have following code hive 2.0.0:
300: if (inputformatclass == null) { 301: try { 302: string classname = ttable.getsd().getinputformat(); 303: if (classname == null) { 304: if (getstoragehandler() == null) { 305: return null; 306: } 307: inputformatclass = getstoragehandler().getinputformatclass(); 308: } else { 309: inputformatclass = (class<? extends inputformat>) 310: class.forname(classname, true, utilities.getsessionspecifiedclassloader()); }
line 302 not return null supposed to. line 310 try load non-existing class in. that's reason why program failed.
i believe compatible bug, way fix change database hate to. replaced 302 with
if (classname == null || classname.tolowercase().startswith("null::")) {
and same thing getoutputformat() method, re-compile jar, that's it.
Comments
Post a Comment