Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive druid handler "java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook"

avatar
Explorer

Hi!

I've installed HDP 2.6 and installed druid. Trying to create external table to a wikiticker datasource gives me an error:

Error: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook (state=,code=0)

I've added druid handler (lib/hive-druid-handler.jar) with "add jar" before. Tried to add hive metastore jar - it did not help. How to use this handler? Thank you!

14 REPLIES 14

avatar
Expert Contributor

Can you add the command used to create the external table please ? BTW you shouldn't have to add the druid storage handler jars it is done automatically.

avatar
Explorer

Hi @Slim!

Thank you for your reply 😉 First I try:

CREATE EXTERNAL TABLE druid_table_1
	STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
	TBLPROPERTIES ("druid.datasource" = "wikiticker");

But no jar:

23:01:08  [CREATE - 0 rows, 0.023 secs]  [Code: 40000, SQL State: 42000]  Error while compiling statement: FAILED: SemanticException Cannot find class 'org.apache.hadoop.hive.druid.DruidStorageHandler'

Than I try to add driver:

add jar hdfs://hdfscian/user/ptarasov/jars/hive-druid-handler.jar;

Ok:

INFO  : converting to local hdfs://hdfscian/user/ptarasov/jars/hive-druid-handler.jar
INFO  : Added [/tmp/e4328d39-3c33-47fd-bd08-c7b0a72dcf73_resources/hive-druid-handler.jar] to class path
INFO  : Added resources: [hdfs://hdfscian/user/ptarasov/jars/hive-druid-handler.jar]

And once again create external table, but no luck:

Error: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook (state=,code=0)

avatar
Expert Contributor

Looks like you are using Old hive CLI driver called Hive1, you need to use Hive2 interactive via Beeline command line on the box it self or via JDBC.

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.0/bk_hive-performance-tuning/content/ch_hive_...

https://community.hortonworks.com/articles/4103/hiveserver2-jdbc-connection-url-examples.html

avatar
Expert Contributor

you can find the jdbc connect string

17480-hdinsight-hadoop-use-interactive-hive-jdbc.png

avatar
Explorer

Hi @Slim! Thank you once again, but unfortunately no, I use beeline and hiveserver2

avatar
Expert Contributor

@Pavel Tarasov are you sure you are using the interactive JDBC link as pointed by the picture above ? Can you run LLAP queries ?

avatar
Explorer

Thank you! I've used hive1, not interactive) With interactive it works, thanks!

avatar
New Contributor

@Slim - Does this mean that Druid can work only with Hive Interactive/LLAP ?

avatar
Expert Contributor

Also you can check what version is shown when you connect via beeline at first place ?