Add more DDL functions for Athena
See original GitHub issueIs your feature request related to a problem? Please describe.
DDL queries of Athena are very important and common commands for users, like describe table
, show create table
, etc. (More DDL queries, please see the official doc: https://docs.aws.amazon.com/athena/latest/ug/language-reference.html)
Describe the solution you’d like
As create_database
, create_parquet_table
in catelog
, repaire_table
in athena
, add more functions like describe_table
, show_create_table
in athena
.
def describe_table(
database: str
table: str
) -> str:
query = f"describe `{database}`.`{table}`;"
if (database is not None) and (not database.startswith("`")):
database = f"`{database}`"
session: boto3.Session = _utils.ensure_session(session=boto3_session)
query_id = start_query_execution(
sql=query,
database=database,
s3_output=s3_output,
workgroup=workgroup,
encryption=encryption,
kms_key=kms_key,
boto3_session=session,
)
response: Dict[str, Any] = wait_query(query_execution_id=query_id, boto3_session=session)
return response["QueryExecution"]["Status"]["State"]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Add more DDL functions for Athena · Issue #306 - GitHub
DDL queries of Athena are very important and common commands for users, like describe table, show create table, etc. (More DDL queries ...
Read more >DDL statements - Amazon Athena - AWS Documentation
Use the following DDL statements directly in Athena. The Athena query engine is based in part on HiveQL DDL . Athena does not...
Read more >Athena SQL basics – How to write SQL against files - OBSTKEL
In this post on Athena SQL we cover Athena String Functions, Date Functions, Window and Aggregate Functions and Athena SQL Types & Operators....
Read more >DDL statements - Amazon Athena
User Guide · Unsupported DDL · ALTER DATABASE SET DBPROPERTIES · ALTER TABLE ADD COLUMNS · ALTER TABLE ADD PARTITION · ALTER TABLE...
Read more >3. AWS Athena - Creating tables and querying data - YouTube
Amazon Athena is an interactive query service that makes it easy to ... DDL statements, and immediately start querying using the built-in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @bryanyang0528 !
It is totally off-topic, but we are stating a “Who uses AWS Data Wrangler?” section. So feel free to add yourself if you want 😄 .
Hi @igorborgest, Appreciate your suggestions. In this case, instead of getting the result from Athena API directly, now I used the way as you mentioned
start_query_execution()
,wait_query()
to generate the result, and I will use another result parser for reading results from s3 and parsing it.wr.catalog.table()
is a good example, I will let the result ofdescribe_table
as same aswr.catelog.table
for consistency.