Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.0
-
None
-
None
-
None
Description
Table ddl:
CREATE EXTERNAL TABLE tmp.la_ocs_edr
(
SPEND_STRUCT map<string,array<map<string,string>>>
)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
LOCATION '/tmp/vm';
Json file structure:
{"SPEND_STRUCT": {"def":[
]}}
{"SPEND_STRUCT": {"def":[
]}}
A select query fails with:
hive> select * from json_example;
OK
Failed with exception java.io.IOException:org.apache.hadoop.hive.serde2.SerDeException: java.io.IOException: Start of Array expected
Same result from beeline.
Strangely, inserting into the table as follows works and the JSON file is populated properly:
hive> insert into json_example select map("def",array(map("COSTS","0","BALANCE_TYPES","128","BALANCES","22"))) from t1;
then
hive> !sh hdfs dfs -cat /user/hive/warehouse/test.db/json_example/*;
{"spend_struct":{"def":[
]}}
Attachments
Issue Links
- supercedes
-
HIVE-18785 Make JSON SerDe First-Class SerDe
- Open