awswrangler.athena.show_create_table¶
- awswrangler.athena.show_create_table(table: str, database: str | None = None, s3_output: str | None = None, workgroup: str = 'primary', encryption: str | None = None, kms_key: str | None = None, athena_query_wait_polling_delay: float = 1.0, s3_additional_kwargs: dict[str, Any] | None = None, boto3_session: Session | None = None) str ¶
Generate the query that created it: ‘SHOW CREATE TABLE table;’.
Analyzes an existing table named table_name to generate the query that created it.
Note
Create the default Athena bucket if it doesn’t exist and s3_output is None. (E.g. s3://aws-athena-query-results-ACCOUNT-REGION/)
Note
Following arguments are not supported in distributed mode with engine EngineEnum.RAY:
boto3_session
Note
This function has arguments which can be configured globally through wr.config or environment variables:
database
athena_query_wait_polling_delay
workgroup
Check out the Global Configurations Tutorial for details.
- Parameters:
table (
str
) – Table name.database (
str
|None
) – AWS Glue/Athena database name.s3_output (
str
|None
) – AWS S3 path.workgroup (
str
) – Athena workgroup. Primary by default.encryption (
str
|None
) – None, ‘SSE_S3’, ‘SSE_KMS’, ‘CSE_KMS’.kms_key (
str
|None
) – For SSE-KMS and CSE-KMS , this is the KMS key ARN or ID.athena_query_wait_polling_delay (
float
) – Interval in seconds for how often the function will check if the Athena query has completed.s3_additional_kwargs (
dict
[str
,Any
] |None
) – Forwarded to botocore requests. e.g. s3_additional_kwargs={‘RequestPayer’: ‘requester’}boto3_session (
Session
|None
) – The default boto3 session will be used if boto3_session receiveNone
.
- Return type:
str
- Returns:
The query that created the table.
Examples
>>> import awswrangler as wr >>> df_table = wr.athena.show_create_table(table='my_table', database='default')