Created
December 13, 2017 16:55
-
-
Save akrylysov/f3b9004410d417604773ff646bb560dc to your computer and use it in GitHub Desktop.
AWS billing Athena schema
This file contains hidden or 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 `billing`( | |
`invoiceid` string, | |
`payeraccountid` string, | |
`linkedaccountid` string, | |
`recordtype` string, | |
`recordid` string, | |
`productname` string, | |
`rateid` string, | |
`subscriptionid` string, | |
`pricingplanid` string, | |
`usagetype` string, | |
`operation` string, | |
`availabilityzone` string, | |
`reservedinstance` string, | |
`itemdescription` string, | |
`usagestartdate` string, | |
`usageenddate` string, | |
`usagequantity` double, | |
`blendedrate` double, | |
`blendedcost` double, | |
`unblendedrate` double, | |
`unblendedcost` double, | |
`resourceid` string, | |
`user_name` string, | |
`user_project` string, | |
`user_role` string) | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' | |
WITH SERDEPROPERTIES ( | |
'separatorChar' = ',', | |
'quoteChar' = '\"', | |
'escapeChar' = '\\' | |
) | |
STORED AS TEXTFILE | |
LOCATION 's3://TODO/' | |
TBLPROPERTIES ("skip.header.line.count"="1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment