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. Want to know more about what has changed? Check out the Community News blog.

Hive - Select working in shell but not in Hue

SOLVED Go to solution

Re: Hive - Select working in shell but not in Hue

Champion Alumni

In the select there was a ',' missing. 

GHERMAN Alina
Highlighted

Re: Hive - Select working in shell but not in Hue

Awesome :)

Re: Hive - Select working in shell but not in Hue

Explorer

hi, Romain, 

 

  I am having the same issue. I just installed CDH5.4 and use json-serde-1.3-jar-with-dependencies.jar to create external table. 

 

CREATE EXTERNAL TABLE IF NOT EXISTS mytable2 (field1 string, field2 int, field3 string, field4 double) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( "ignore.malformed.json" = "true") LOCATION '/tmp/mytable2';

 

The testing data is: 

{"field1":"data1","field2":100,"field3":"more data1","field4":123.001}

 

In Hive CLI I am able to query the table. But when I use beeline or Hue interface, I got the same error: 

Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer (state=,code=0)

 

I have copied the json-serde-1.3-jar-with-dependencies.jar to the following directory but it still does not work:

/var/opt/cloudera/parcels/CDH/lib/hive/lib/

/var/opt/cloudera/parcels/CDH/lib/hadoop/lib/

/var/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce/lib/

/var/opt/cloudera/parcels/CDH/lib/hadoop-0.20-mapreduce/lib/

 

  Do you know the reason? 

 

thanks

Bin

 

Re: Hive - Select working in shell but not in Hue

Did you load the jar in the editor?

A bit like http://gethue.com/hadoop-tutorial-hive-udf-in-1-minute/



Re: Hive - Select working in shell but not in Hue

New Contributor

Hi Romainr,
I am using cdh5.5.2 with Hue 3.9.0.
As part of Hive Config, I have set Hive Auxiliary JARs Directory as '/usr/lib/hive/lib' which contains the Json Serde Jar.
Further I have -
1) Using Hive Command Line - Created a table in Hive, with [ ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe' ]
2) Loaded sample data to Hive table
3) Ran 'select * tableName;' successfully.
4) When I ran the same in < Hue - Hive Editor >, I am facing the following error-
FAILED: RuntimeException MetaException(message:java.lang.ClassNotFoundException Class com.cloudera.hive.serde.JSONSerDe not found)

Can you please advise ?