<?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 Hive kafka integration giving error class not found exception : message:java.lang.ClassNotFoundException Class org.apache.hadoop.hive.kafka.KafkaSerDe not found in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-kafka-integration-giving-error-class-not-found/m-p/269580#M206941</link>
    <description>&lt;P&gt;&lt;FONT&gt;Hi Team,&lt;BR /&gt;I was trying to read data from kafka topics by using hive table.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SInce my data is in avro format so trying to create a hive using below statement:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;BR /&gt;CREATE EXTERNAL TABLE kafka_t_avro&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (`timestamp` timestamp , `page` string,&amp;nbsp; `newPage` boolean,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; added int, deleted bigint, delta double)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; STORED BY 'org.apache.hadoop.hive.kafka.KafkaStorageHandler'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TBLPROPERTIES&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ("kafka.topic" = "topic-name",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "kafka.bootstrap.servers"="hostname:9092",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "kafka.serde.class"="org.apache.hadoop.hive.serde2.avro.AvroSerDe");&lt;BR /&gt;It is giving me below error:&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:java.lang.ClassNotFoundException Class org.apache.hadoop.hive.kafka.KafkaSerDe not found).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I have added the below jars in my class path:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;kafka-handler-3.1.0.3.1.0.0-78.jar;&lt;BR /&gt;hive-serde-0.10.0.jar;&lt;BR /&gt;hive-exec-3.1.0.3.1.0.0-78.jar;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/50614"&gt;@jsensharma&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 02:36:13 GMT</pubDate>
    <dc:creator>yukti</dc:creator>
    <dc:date>2019-09-03T02:36:13Z</dc:date>
    <item>
      <title>Hive kafka integration giving error class not found exception : message:java.lang.ClassNotFoundException Class org.apache.hadoop.hive.kafka.KafkaSerDe not found</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-kafka-integration-giving-error-class-not-found/m-p/269580#M206941</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi Team,&lt;BR /&gt;I was trying to read data from kafka topics by using hive table.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SInce my data is in avro format so trying to create a hive using below statement:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;BR /&gt;CREATE EXTERNAL TABLE kafka_t_avro&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (`timestamp` timestamp , `page` string,&amp;nbsp; `newPage` boolean,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; added int, deleted bigint, delta double)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; STORED BY 'org.apache.hadoop.hive.kafka.KafkaStorageHandler'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TBLPROPERTIES&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ("kafka.topic" = "topic-name",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "kafka.bootstrap.servers"="hostname:9092",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "kafka.serde.class"="org.apache.hadoop.hive.serde2.avro.AvroSerDe");&lt;BR /&gt;It is giving me below error:&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:java.lang.ClassNotFoundException Class org.apache.hadoop.hive.kafka.KafkaSerDe not found).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I have added the below jars in my class path:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;kafka-handler-3.1.0.3.1.0.0-78.jar;&lt;BR /&gt;hive-serde-0.10.0.jar;&lt;BR /&gt;hive-exec-3.1.0.3.1.0.0-78.jar;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/50614"&gt;@jsensharma&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 02:36:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-kafka-integration-giving-error-class-not-found/m-p/269580#M206941</guid>
      <dc:creator>yukti</dc:creator>
      <dc:date>2019-09-03T02:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hive kafka integration giving error class not found exception : message:java.lang.ClassNotFoundException Class org.apache.hadoop.hive.kafka.KafkaSerDe not found</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-kafka-integration-giving-error-class-not-found/m-p/269612#M206967</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/69080"&gt;@yukti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you have already got the 3.1.0.0-78 version of JARs so for the missing class "org.apache.hadoop.hive.kafka.KafkaSerDe" can you try using the following JAR (instead of "hive-serde-0.10.0.jar'")?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In My HDP 3 installation on hive host i can see it here "&amp;nbsp;usr/hdp/current/hive-server2/lib/&lt;EM&gt;&lt;STRONG&gt;kafka-handler-3.1.0.3.1.0.0-78.jar&lt;/STRONG&gt;&lt;/EM&gt;"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# /usr/jdk64/jdk1.8.0_112/bin/javap -cp /usr/hdp/current/hive-server2/lib/kafka-handler-3.1.0.3.1.0.0-78.jar org.apache.hadoop.hive.kafka.KafkaSerDe

Compiled from "KafkaSerDe.java"
public class org.apache.hadoop.hive.kafka.KafkaSerDe extends org.apache.hadoop.hive.serde2.AbstractSerDe {
  public org.apache.hadoop.hive.kafka.KafkaSerDe();
  public void initialize(org.apache.hadoop.conf.Configuration, java.util.Properties) throws org.apache.hadoop.hive.serde2.SerDeException;
  public java.lang.Class&amp;lt;? extends org.apache.hadoop.io.Writable&amp;gt; getSerializedClass();
  public org.apache.hadoop.io.Writable serialize(java.lang.Object, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector) throws org.apache.hadoop.hive.serde2.SerDeException;
  public org.apache.hadoop.hive.serde2.SerDeStats getSerDeStats();
  public java.lang.Object deserialize(org.apache.hadoop.io.Writable) throws org.apache.hadoop.hive.serde2.SerDeException;
  java.util.ArrayList&amp;lt;java.lang.Object&amp;gt; deserializeKWritable(org.apache.hadoop.hive.kafka.KafkaWritable) throws org.apache.hadoop.hive.serde2.SerDeException;
  public org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getObjectInspector();
  static {};
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 08:05:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-kafka-integration-giving-error-class-not-found/m-p/269612#M206967</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-09-03T08:05:41Z</dc:date>
    </item>
  </channel>
</rss>

