Created
March 21, 2021 08:39
-
-
Save suzukiken/79177cf0af6eedb5c73216ef09ccd3c0 to your computer and use it in GitHub Desktop.
Sample create table sql for Athena
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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