· 9 years ago · Nov 26, 2016, 02:34 PM
1ADD JAR s3://YOUR_BUCKET_NAME/path/to/json-serde-1.3.7-jar-with-dependencies.jar;
2
3CREATE EXTERNAL TABLE IF NOT EXISTS test.nested_json_table (
4 column1 string,
5 column2 array<int>,
6 column3 struct<
7 nestedcolumn1: array<string>,
8 nestedcolumn2: array<
9 struct<
10 morenestedarraycolumn1: int,
11 morenestedarraycolumn2: array<string>
12 >
13 >,
14 nestedcolumn3: struct<
15 morenestedcolumn1: double,
16 morenestedcolumn2: string
17 >
18 >
19)
20ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' STORED AS TEXTFILE
21LOCATION 's3://YOUR_JSON_DATA_LOCATION/';