Reply
New Contributor
Posts: 5
Registered: ‎10-25-2016

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

[ Edited ]

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

 

Cloudera Employee
Posts: 696
Registered: ‎07-30-2013

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

New Contributor
Posts: 1
Registered: ‎03-17-2017

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

How does this response help?

Highlighted
Cloudera Employee
Posts: 16
Registered: ‎08-16-2016

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

[ Edited ]

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". 

 

 

Announcements