hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sunita Arvind <sunitarv...@gmail.com>
Subject Hive select shows null after successful data load
Date Tue, 18 Jun 2013 18:24:11 GMT
Hi,

I am able to parse the input JSON file and load it into hive. I do not see
any errors with create table, so I am assuming that. But when I try to read
the data, I get null

hive> select * from jobs;
OK
null

I have validated the JSON with JSONLint and Notepad++ JSON plugin and it is
a valid JSON. Here is my create table statement and attached is the json
input file.

create external table jobs (
jobs STRUCT<
values : ARRAY<STRUCT<
company : STRUCT<
id : STRING,
name : STRING>,
postingDate : STRUCT<
year : INT,
day : INT,
month : INT>,
descriptionSnippet : STRING,
expirationDate : STRUCT<
year : INT,
day : INT,
month : INT>,
position : STRUCT<
title : STRING,
jobFunctions : ARRAY<STRUCT<
code : STRING,
name : STRING>>,
industries : ARRAY<STRUCT<
code : STRING,
id : STRING,
name : STRING>>,
jobType : STRUCT<
code : STRING,
name : STRING>,
experienceLevel : STRUCT<
code : STRING,
name : STRING>>,
id : STRING,
customerJobCode : STRING,
skillsAndExperience : STRING,
salary : STRING,
jobPoster : STRUCT<
id : STRING,
firstName : STRING,
lastName : STRING,
headline : STRING>,
referralBonus : STRING,
locationDescription : STRING>>>
 )
ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
LOCATION '/user/sunita/tables/jobs';

The table creation works fine, but when I attempt to query, I get null as
the result.
I tried adding Input/Output formats, Serde Properties, nothing seems to
impact.

I am of the opinion that the libraries cannot handle this level of nesting
and I probably will have to write a custom serde or a parser myself. Just
wanted to seek guidance before I get into that. Appreciate your help and
guidance.

regards
Sunita

Mime
View raw message