Created on 01-22-2015 12:40 AM - edited 09-16-2022 02:20 AM
Hello,
I created a json table in Hive and then I loaded data from a folder into it. The query is sucessful.
ADD JAR /data/hive/jars/json-serde-1.3-jar-with-dependencies.jar;
Select * from myTable
However, when I try to access the table I get an error:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
When I try to access the same table with the same query in Hive shell I do not get any error and I can acess the table.
Where should I look for? IS there any other jar that I have to add in order to make this work in beeswax(hue)?
Thank you!
Created 02-03-2015 06:01 AM
Created 02-03-2015 06:01 AM
In the select there was a ',' missing.
Created 02-03-2015 06:26 AM
Created 05-01-2015 04:35 PM
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
Created 05-04-2015 08:58 PM
Created on 05-17-2016 10:06 AM - edited 05-17-2016 10:21 AM
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 ?