Support Questions
Find answers, ask questions, and share your expertise

Creating hive table to read data from kafka topics giving error "Error: Error running query: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook (state=,code=0)"

Creating hive table to read data from kafka topics giving error "Error: Error running query: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook (state=,code=0)"

Explorer

I am trying to create a hive table to read data from kafka topics :

create table statement:

 

CREATE EXTERNAL TABLE kafka_table
  (`timestamp` timestamp , `page` string,  `newPage` boolean,
  added int, deleted bigint, delta double)
  STORED BY 'org.apache.hadoop.hive.kafka.KafkaStorageHandler'
  TBLPROPERTIES
  ("kafka.topic" = "kafka-topic-name", "kafka.bootstrap.servers"="hostname:9092");

 

add jar /home//kafka-handler-3.1.0.3.1.0.0-78.jar;
add jar /home//hive-serde-0.10.0.jar;
add jar /home//hive-metastore-0.9.0.jar;

 

giving me below error:

 

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.metastore.DefaultHiveMetaHook
org/apache/hadoop/hive/metastore/DefaultHiveMetaHook

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

 

I am not able to find out this jar online anywhere.

I am using CDH 6.2.0 and respective parcels for hive and spark.

1 REPLY 1
Highlighted

Re: Creating hive table to read data from kafka topics giving error "Error: Error running query: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/DefaultHiveMetaHook (state=,code=0)"

Explorer

have you found a solution? I'm facing the same issue.

 

I tried using /hive-standalone-metastore-3.1.2000.7.0.3.0-79.jar

and hive-metastore-2.1.1-cdh6.2.0.jar, but all of them seemed not working.