ClassNotFoundException : com.cloudera.hive.serde.JSONSerDe
2 Answer(s)
DeZyre Support
hi Deepthi,
The JSONSerDe was provided in Advanced Hive module and is available from LMS. Place this serde in the local FS and add that as a resource into Hive before you create the external table as below
ADD JAR /home/cloudera/work/des/module8/PythonCode/hive-json-serde-0.2.jar;
CREATE EXTERNAL TABLE `player_opposition_runs_json`(
`player_id` int,
`year_of_play` int,
`country` string,
`opposition_country` string,
`runs_scored` int,
`balls_played` int)
COMMENT 'This is the player_opposition_runs_json table'
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
WITH SERDEPROPERTIES (
"player_id"="$.player_id",
"year_of_play"="$.year_of_play",
"country"="$.country",
"opposition_country"="$.opposition_country",
"runs_scored"="$.runs_scored",
"balls_played"="$.balls_played"
)
LOCATION
'/user/cloudera/hive_examples/runs_opposition_json';
Thanks
Feb 08 2015 11:22 AM
The JSONSerDe was provided in Advanced Hive module and is available from LMS. Place this serde in the local FS and add that as a resource into Hive before you create the external table as below
ADD JAR /home/cloudera/work/des/module8/PythonCode/hive-json-serde-0.2.jar;
CREATE EXTERNAL TABLE `player_opposition_runs_json`(
`player_id` int,
`year_of_play` int,
`country` string,
`opposition_country` string,
`runs_scored` int,
`balls_played` int)
COMMENT 'This is the player_opposition_runs_json table'
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde'
WITH SERDEPROPERTIES (
"player_id"="$.player_id",
"year_of_play"="$.year_of_play",
"country"="$.country",
"opposition_country"="$.opposition_country",
"runs_scored"="$.runs_scored",
"balls_played"="$.balls_played"
)
LOCATION
'/user/cloudera/hive_examples/runs_opposition_json';
Thanks
SACHIN
Apr 02 2016 01:54 AM
I am getting the following error and unable to proceed further:
FAILED: Error in metadata: java.lang.NullPointerException
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask