Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe

avatar
New Contributor

I'm trying to read json file via hive external table.

I'm missing SerDe, I couldn't fine the instruction to add it.

The full error is:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe 17/03/21 06:07:52 [HiveServer2-Background-Pool: Thread-89]: ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe

In the hive:

CREATE EXTERNAL TABLE IF NOT EXISTS ViewClicks ( location_text string, match_level tinyint) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' STORED AS TEXTFILE LOCATION '/user/root/DBA/ClickStream';

,

Hi

Trying to read json file usign hive failes with error:

ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.apache.hive.hcatalog.data.JsonSerDe (state=08S01,code=1)

Here is the code for the table creation.

CREATE EXTERNAL TABLE IF NOT EXISTS t1 ( location_text string, match_level tinyint ) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' STORED AS TEXTFILE LOCATION '/user/root/DBA/ClickStream';

How to I install the SerDe on hive?

1 REPLY 1

avatar

What is the installer and HDP version here? org.apache.hive.hcatalog.data.JsonSerDe is provided by $HCAT_HOME/share/hcatalog/hive-hcatalog-core.jar. In a standard Ambari install this is added to Hive classpath by setting it in HIVE_AUX_JARS_PATH in $HIVE_CONF_DIR/hive-env.sh.