我正在尝试从此 json 上传数据:
JSON-A
[
{"name": "james", "id": 41},
{"name": "scott", "id": 62},
{"name": "abhi", "id": 16},
{"name": "kevin", "id": 53},
{"name": "beau", "id": 12},
{"name": "shally", "id": 35},
{"name": "jude", "id": 53},
{"name": "jason", "id": 77},
{"name": "hongjian", "id": 35},
{"name": "madhur", "id": 6}
]
如果它具有父“数据”键,例如
JSON-B
["data":{"name": "james","id": 41"},{.....}]
然后我知道我可以这样做:
CREATE EXTERNAL TABLE IF NOT EXISTS test.test (
`data` array<struct<`name`:string,`id`:bigint>>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1'
) LOCATION 's3://test-bucket/';
但是 JSON-A 应该怎么做呢?