Open
Description
-
I'm submitting a ...
- 🪲 bug report
- 🚀 feature request
- 📚 construct library gap
- ☎️ security issue or vulnerability => Please see policy
- ❓ support request => Please see note at the top of this template.
-
What is the current behavior?
Athena Cfn and SDKs don't expose a friendly way to create tables -
What is the expected behavior (or behavior of feature suggested)?
I'd propose a construct that takes -
bucket name
-
path
-
columns: list of tuples (name, type)
-
data format (probably best as an enum)
-
partitions (subset of columns)
Then uses the AWS SDK Custom Resource on the Athena SDK to execute
querystring = """
CREATE EXTERNAL TABLE IF NOT EXISTS mydb.table_name (
`columns[0][0]` columns[0][1],
`columns[1][0]` columns[1][1]
etc...
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES (
{data_format}
) LOCATION 's3://{bucket_name}/{path}'
TBLPROPERTIES ('has_encrypted_data'='false');
"""
response = client.start_query_execution(
QueryString=querystring,
ClientRequestToken='string',
QueryExecutionContext={
'Database': 'string'
},
ResultConfiguration={
'OutputLocation': 'string',
'EncryptionConfiguration': {
'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS',
'KmsKey': 'string'
}
},
WorkGroup='string'
)
-
What is the motivation / use case for changing the behavior or adding this feature?
Athena is the goddess of wisdom and civilization, how can we be a civilized developer tool if we don't support her? -
Please tell us about your environment:
All of them -
Other information
<3