question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more DDL functions for Athena

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
igorborgestcommented, Aug 7, 2020

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 😄 .

1reaction
bryanyang0528commented, Jul 15, 2020

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 of describe_table as same as wr.catelog.table for consistency.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found