Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

New Contributor

After create my DB table in MySQL

CREATE EXTERNAL TABLE tweets (

  id BIGINT,

  created_at STRING,

  source STRING,

  favorited BOOLEAN,

  retweeted_status STRUCT<

    text:STRING,

    user:STRUCT<screen_name:STRING,name:STRING>,

    retweet_count:INT>,

  entities STRUCT<

    urls:ARRAY<STRUCT<expanded_url:STRING>>,

    user_mentions:ARRAY<STRUCT<screen_name:STRING,name:STRING>>,

    hashtags:ARRAY<STRUCT<text:STRING>>>,

  text STRING,

  user STRUCT<

    screen_name:STRING,

    name:STRING,

    friends_count:INT,

    followers_count:INT,

    statuses_count:INT,

    verified:BOOLEAN,

    utc_offset:INT,

    time_zone:STRING>,

  in_reply_to_screen_name STRING

)

PARTITIONED BY (datehour INT)

ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'

LOCATION '/user/flume/tweets';

 

When I try to view the contents of my table in HUE-UI Metastore Manager the following error occurs:

 

error while processing statement failed execution error return code 1 from org.apache.hadoop.hive.sql.exec.DDLTask.java.lang.ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

 

I added the necessary jars:

$>su hdfs

$hdfs>hive

     hive> ADD JAR /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serde.jar;

         Added [/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serde.jar] to class path
         Added resources: [/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serde.jar]

     hive>ADD JAR /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serdes-1.0-SNAPSHOT.jar;

         Added [/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serdes-1.0-SNAPSHOT.jar] to class path
Added resources: [/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serdes-1.0-SNAPSHOT.jar]

hive> list JAR;
/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serde.jar
/opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-serdes-1.0-SNAPSHOT.jar

 

Inside hive-serdes-1.0-SNAPSHOT.jar:

com\cloudera\hive\serde\JSONSerDe.class

 

 Following https://community.cloudera.com/t5/Batch-SQL-Apache-Hive/Adding-Hive-SerDe-jar-on-SparkSQL-Thrift-Ser...

 

I´ve add hive-hcatalog-core.jar

hive>ADD JAR /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive-hcatalog/share/hcatalog/hive-hcatalog-core.jar

 

And I´ve modified sql:

CREATE EXTERNAL TABLE tweetsNEW (
id BIGINT,
created_at STRING,
source STRING,
favorited BOOLEAN,
retweeted_status STRUCT<
text:STRING,
user:STRUCT<screen_name:STRING,name:STRING>,
retweet_count:INT>,
entities STRUCT<
urls:ARRAY<STRUCT<expanded_url:STRING>>,
user_mentions:ARRAY<STRUCT<screen_name:STRING,name:STRING>>,
hashtags:ARRAY<STRUCT<text:STRING>>>,
text STRING,
user STRUCT<
screen_name:STRING,
name:STRING,
friends_count:INT,
followers_count:INT,
statuses_count:INT,
verified:BOOLEAN,
utc_offset:INT,
time_zone:STRING>,
in_reply_to_screen_name STRING
)
PARTITIONED BY (datehour INT)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
LOCATION '/user/flume/tweets';

 

I still find the same error

 

3 REPLIES 3

Re: ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

Re: ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

New Contributor

How does this response help?

Re: ClassNotFoundException com.cloudera.hive.serde.JSONSserDe not found

Cloudera Employee

Hi, Jorge. Maybe you could try creating a table in Hive with:

 

ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'

 

To see your table in Impala, click the refresh icon and select "Perform incremental metadata update".