Skip to content

Instantly share code, notes, and snippets.

@suzukiken
Created March 21, 2021 08:39
Show Gist options
  • Save suzukiken/79177cf0af6eedb5c73216ef09ccd3c0 to your computer and use it in GitHub Desktop.
Save suzukiken/79177cf0af6eedb5c73216ef09ccd3c0 to your computer and use it in GitHub Desktop.
Sample create table sql for Athena
CREATE EXTERNAL TABLE IF NOT EXISTS table_name (
Item struct <
id:struct <
S:string
>,
address:struct <
M:struct <
zip:struct <
S:string
>,
city:struct <
S:string
>
>
>,
products:struct <
L:array <
struct <
M:struct <
sku:struct <
N:int
>,
price:struct <
N:int
>,
name:struct <
S:string
>
>
>
>
>
>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
LOCATION '$location'
TBLPROPERTIES ( 'has_encrypted_data'='true');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment