I have a usecase where I am getting an input json file. The file has an array of json -
[{json1},{json2},{json3},{json4}, .... 100 json responses]
The sample of structure of json 1,2,3,4.. is
{"AuthorisedSenderId": "1", "cid":"1", "id":"1" }
I created a table
CREATE EXTERNAL TABLE db1.sample_table(
authorisedsenderid string,
cid string,
id string)
ROW FORMAT SERDE
'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs:XXXX'
I could successfully load the input file if the file had only json1 (without the array).
LOAD DATA INPATH 'filelocation' OVERWRITE INTO TABLE db1.sample_table
but if the input file contains an array of json, unable to load.
Could you please help me define the CREATE TABLE command to ingest array of json?
