Forked from EngineerLabShimazu/amazon_athena_create_table.ddl
Created
October 26, 2022 06:36
-
-
Save vaquarkhan/f3abd2f3a3238006647d44c65f70b77c to your computer and use it in GitHub Desktop.
Create a table in Athena from a csv file with header stored in S3.
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 IF NOT EXISTS default.table | |
| ( | |
| `id` int, | |
| `name` string, | |
| `timestamp` string, | |
| `is_debug` boolean | |
| ) | |
| ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' | |
| WITH SERDEPROPERTIES ( | |
| 'escapeChar'='\\', | |
| 'quoteChar'='\"', | |
| 'serialization.format' = ',', | |
| 'field.delim' = ',' | |
| ) | |
| LOCATION 's3://your-bucket-name-xxxxx/your/folder' | |
| TBLPROPERTIES ( | |
| 'skip.header.line.count'='1' | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment