AthenaClient
Auto-generated documentation for Athena type annotations stubs module types-aiobotocore-athena.
AthenaClient
Type annotations and code completion for session.client("athena")
boto3 documentation
from aioboto3.session import Session
from types_aiobotocore_athena.client import AthenaClient
session = Session()
async with session.client("athena") as client:
client: AthenaClient
Exceptions
aioboto3
client exceptions are generated in runtime.
This class provides code completion for session.client("athena").exceptions
structure.
async with session.client("athena") as client:
try:
do_something(client)
except (
client.ClientError,
client.InternalServerException,
client.InvalidRequestException,
client.MetadataException,
client.ResourceNotFoundException,
client.TooManyRequestsException,
) as e:
print(e)
from types_aiobotocore_athena.client import Exceptions
def handle_error(exc: Exceptions.ClientError) -> None:
...
Methods
batch_get_named_query
Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings.
Type annotations and code completion for session.client("athena").batch_get_named_query
method.
boto3 documentation
await def batch_get_named_query(
self,
*,
NamedQueryIds: Sequence[str],
) -> BatchGetNamedQueryOutputTypeDef: # (1)
...
kwargs: BatchGetNamedQueryInputRequestTypeDef = { # (1)
"NamedQueryIds": ...,
}
parent.batch_get_named_query(**kwargs)
batch_get_prepared_statement
Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide.
Type annotations and code completion for session.client("athena").batch_get_prepared_statement
method.
boto3 documentation
await def batch_get_prepared_statement(
self,
*,
PreparedStatementNames: Sequence[str],
WorkGroup: str,
) -> BatchGetPreparedStatementOutputTypeDef: # (1)
...
kwargs: BatchGetPreparedStatementInputRequestTypeDef = { # (1)
"PreparedStatementNames": ...,
"WorkGroup": ...,
}
parent.batch_get_prepared_statement(**kwargs)
batch_get_query_execution
Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings.
Type annotations and code completion for session.client("athena").batch_get_query_execution
method.
boto3 documentation
await def batch_get_query_execution(
self,
*,
QueryExecutionIds: Sequence[str],
) -> BatchGetQueryExecutionOutputTypeDef: # (1)
...
kwargs: BatchGetQueryExecutionInputRequestTypeDef = { # (1)
"QueryExecutionIds": ...,
}
parent.batch_get_query_execution(**kwargs)
can_paginate
Check if an operation can be paginated.
Type annotations and code completion for session.client("athena").can_paginate
method.
boto3 documentation
close
Closes underlying endpoint connections.
Type annotations and code completion for session.client("athena").close
method.
boto3 documentation
create_data_catalog
Creates (registers) a data catalog with the specified name and properties.
Type annotations and code completion for session.client("athena").create_data_catalog
method.
boto3 documentation
await def create_data_catalog(
self,
*,
Name: str,
Type: DataCatalogTypeType, # (1)
Description: str = ...,
Parameters: Mapping[str, str] = ...,
Tags: Sequence[TagTypeDef] = ..., # (2)
) -> Dict[str, Any]:
...
- See DataCatalogTypeType
- See TagTypeDef
kwargs: CreateDataCatalogInputRequestTypeDef = { # (1)
"Name": ...,
"Type": ...,
}
parent.create_data_catalog(**kwargs)
create_named_query
Creates a named query in the specified workgroup.
Type annotations and code completion for session.client("athena").create_named_query
method.
boto3 documentation
await def create_named_query(
self,
*,
Name: str,
Database: str,
QueryString: str,
Description: str = ...,
ClientRequestToken: str = ...,
WorkGroup: str = ...,
) -> CreateNamedQueryOutputTypeDef: # (1)
...
kwargs: CreateNamedQueryInputRequestTypeDef = { # (1)
"Name": ...,
"Database": ...,
"QueryString": ...,
}
parent.create_named_query(**kwargs)
create_prepared_statement
Creates a prepared statement for use with SQL queries in Athena.
Type annotations and code completion for session.client("athena").create_prepared_statement
method.
boto3 documentation
await def create_prepared_statement(
self,
*,
StatementName: str,
WorkGroup: str,
QueryStatement: str,
Description: str = ...,
) -> Dict[str, Any]:
...
kwargs: CreatePreparedStatementInputRequestTypeDef = { # (1)
"StatementName": ...,
"WorkGroup": ...,
"QueryStatement": ...,
}
parent.create_prepared_statement(**kwargs)
create_work_group
Creates a workgroup with the specified name.
Type annotations and code completion for session.client("athena").create_work_group
method.
boto3 documentation
await def create_work_group(
self,
*,
Name: str,
Configuration: WorkGroupConfigurationTypeDef = ..., # (1)
Description: str = ...,
Tags: Sequence[TagTypeDef] = ..., # (2)
) -> Dict[str, Any]:
...
kwargs: CreateWorkGroupInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.create_work_group(**kwargs)
delete_data_catalog
Deletes a data catalog.
Type annotations and code completion for session.client("athena").delete_data_catalog
method.
boto3 documentation
kwargs: DeleteDataCatalogInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.delete_data_catalog(**kwargs)
delete_named_query
Deletes the named query if you have access to the workgroup in which the query was saved.
Type annotations and code completion for session.client("athena").delete_named_query
method.
boto3 documentation
kwargs: DeleteNamedQueryInputRequestTypeDef = { # (1)
"NamedQueryId": ...,
}
parent.delete_named_query(**kwargs)
delete_prepared_statement
Deletes the prepared statement with the specified name from the specified workgroup.
Type annotations and code completion for session.client("athena").delete_prepared_statement
method.
boto3 documentation
await def delete_prepared_statement(
self,
*,
StatementName: str,
WorkGroup: str,
) -> Dict[str, Any]:
...
kwargs: DeletePreparedStatementInputRequestTypeDef = { # (1)
"StatementName": ...,
"WorkGroup": ...,
}
parent.delete_prepared_statement(**kwargs)
delete_work_group
Deletes the workgroup with the specified name.
Type annotations and code completion for session.client("athena").delete_work_group
method.
boto3 documentation
await def delete_work_group(
self,
*,
WorkGroup: str,
RecursiveDeleteOption: bool = ...,
) -> Dict[str, Any]:
...
kwargs: DeleteWorkGroupInputRequestTypeDef = { # (1)
"WorkGroup": ...,
}
parent.delete_work_group(**kwargs)
generate_presigned_url
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for session.client("athena").generate_presigned_url
method.
boto3 documentation
await def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_data_catalog
Returns the specified data catalog.
Type annotations and code completion for session.client("athena").get_data_catalog
method.
boto3 documentation
await def get_data_catalog(
self,
*,
Name: str,
) -> GetDataCatalogOutputTypeDef: # (1)
...
kwargs: GetDataCatalogInputRequestTypeDef = { # (1)
"Name": ...,
}
parent.get_data_catalog(**kwargs)
get_database
Returns a database object for the specified database and data catalog.
Type annotations and code completion for session.client("athena").get_database
method.
boto3 documentation
await def get_database(
self,
*,
CatalogName: str,
DatabaseName: str,
) -> GetDatabaseOutputTypeDef: # (1)
...
kwargs: GetDatabaseInputRequestTypeDef = { # (1)
"CatalogName": ...,
"DatabaseName": ...,
}
parent.get_database(**kwargs)
get_named_query
Returns information about a single query.
Type annotations and code completion for session.client("athena").get_named_query
method.
boto3 documentation
await def get_named_query(
self,
*,
NamedQueryId: str,
) -> GetNamedQueryOutputTypeDef: # (1)
...
kwargs: GetNamedQueryInputRequestTypeDef = { # (1)
"NamedQueryId": ...,
}
parent.get_named_query(**kwargs)
get_prepared_statement
Retrieves the prepared statement with the specified name from the specified workgroup.
Type annotations and code completion for session.client("athena").get_prepared_statement
method.
boto3 documentation
await def get_prepared_statement(
self,
*,
StatementName: str,
WorkGroup: str,
) -> GetPreparedStatementOutputTypeDef: # (1)
...
kwargs: GetPreparedStatementInputRequestTypeDef = { # (1)
"StatementName": ...,
"WorkGroup": ...,
}
parent.get_prepared_statement(**kwargs)
get_query_execution
Returns information about a single execution of a query if you have access to the workgroup in which the query ran.
Type annotations and code completion for session.client("athena").get_query_execution
method.
boto3 documentation
await def get_query_execution(
self,
*,
QueryExecutionId: str,
) -> GetQueryExecutionOutputTypeDef: # (1)
...
kwargs: GetQueryExecutionInputRequestTypeDef = { # (1)
"QueryExecutionId": ...,
}
parent.get_query_execution(**kwargs)
get_query_results
Streams the results of a single query execution specified by QueryExecutionId
from the Athena query results location in Amazon S3.
Type annotations and code completion for session.client("athena").get_query_results
method.
boto3 documentation
await def get_query_results(
self,
*,
QueryExecutionId: str,
NextToken: str = ...,
MaxResults: int = ...,
) -> GetQueryResultsOutputTypeDef: # (1)
...
kwargs: GetQueryResultsInputRequestTypeDef = { # (1)
"QueryExecutionId": ...,
}
parent.get_query_results(**kwargs)
get_query_runtime_statistics
Returns query execution runtime statistics related to a single execution of a query if you have access to the workgroup in which the query ran.
Type annotations and code completion for session.client("athena").get_query_runtime_statistics
method.
boto3 documentation
await def get_query_runtime_statistics(
self,
*,
QueryExecutionId: str,
) -> GetQueryRuntimeStatisticsOutputTypeDef: # (1)
...
kwargs: GetQueryRuntimeStatisticsInputRequestTypeDef = { # (1)
"QueryExecutionId": ...,
}
parent.get_query_runtime_statistics(**kwargs)
get_table_metadata
Returns table metadata for the specified catalog, database, and table.
Type annotations and code completion for session.client("athena").get_table_metadata
method.
boto3 documentation
await def get_table_metadata(
self,
*,
CatalogName: str,
DatabaseName: str,
TableName: str,
) -> GetTableMetadataOutputTypeDef: # (1)
...
kwargs: GetTableMetadataInputRequestTypeDef = { # (1)
"CatalogName": ...,
"DatabaseName": ...,
"TableName": ...,
}
parent.get_table_metadata(**kwargs)
get_work_group
Returns information about the workgroup with the specified name.
Type annotations and code completion for session.client("athena").get_work_group
method.
boto3 documentation
await def get_work_group(
self,
*,
WorkGroup: str,
) -> GetWorkGroupOutputTypeDef: # (1)
...
kwargs: GetWorkGroupInputRequestTypeDef = { # (1)
"WorkGroup": ...,
}
parent.get_work_group(**kwargs)
list_data_catalogs
Lists the data catalogs in the current Amazon Web Services account.
Type annotations and code completion for session.client("athena").list_data_catalogs
method.
boto3 documentation
await def list_data_catalogs(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListDataCatalogsOutputTypeDef: # (1)
...
kwargs: ListDataCatalogsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_data_catalogs(**kwargs)
list_databases
Lists the databases in the specified data catalog.
Type annotations and code completion for session.client("athena").list_databases
method.
boto3 documentation
await def list_databases(
self,
*,
CatalogName: str,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListDatabasesOutputTypeDef: # (1)
...
kwargs: ListDatabasesInputRequestTypeDef = { # (1)
"CatalogName": ...,
}
parent.list_databases(**kwargs)
list_engine_versions
Returns a list of engine versions that are available to choose from, including the Auto option.
Type annotations and code completion for session.client("athena").list_engine_versions
method.
boto3 documentation
await def list_engine_versions(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListEngineVersionsOutputTypeDef: # (1)
...
kwargs: ListEngineVersionsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_engine_versions(**kwargs)
list_named_queries
Provides a list of available query IDs only for queries saved in the specified workgroup.
Type annotations and code completion for session.client("athena").list_named_queries
method.
boto3 documentation
await def list_named_queries(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
WorkGroup: str = ...,
) -> ListNamedQueriesOutputTypeDef: # (1)
...
kwargs: ListNamedQueriesInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_named_queries(**kwargs)
list_prepared_statements
Lists the prepared statements in the specified workgroup.
Type annotations and code completion for session.client("athena").list_prepared_statements
method.
boto3 documentation
await def list_prepared_statements(
self,
*,
WorkGroup: str,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListPreparedStatementsOutputTypeDef: # (1)
...
kwargs: ListPreparedStatementsInputRequestTypeDef = { # (1)
"WorkGroup": ...,
}
parent.list_prepared_statements(**kwargs)
list_query_executions
Provides a list of available query execution IDs for the queries in the specified workgroup.
Type annotations and code completion for session.client("athena").list_query_executions
method.
boto3 documentation
await def list_query_executions(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
WorkGroup: str = ...,
) -> ListQueryExecutionsOutputTypeDef: # (1)
...
kwargs: ListQueryExecutionsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_query_executions(**kwargs)
list_table_metadata
Lists the metadata for the tables in the specified data catalog database.
Type annotations and code completion for session.client("athena").list_table_metadata
method.
boto3 documentation
await def list_table_metadata(
self,
*,
CatalogName: str,
DatabaseName: str,
Expression: str = ...,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListTableMetadataOutputTypeDef: # (1)
...
kwargs: ListTableMetadataInputRequestTypeDef = { # (1)
"CatalogName": ...,
"DatabaseName": ...,
}
parent.list_table_metadata(**kwargs)
list_tags_for_resource
Lists the tags associated with an Athena workgroup or data catalog resource.
Type annotations and code completion for session.client("athena").list_tags_for_resource
method.
boto3 documentation
await def list_tags_for_resource(
self,
*,
ResourceARN: str,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListTagsForResourceOutputTypeDef: # (1)
...
kwargs: ListTagsForResourceInputRequestTypeDef = { # (1)
"ResourceARN": ...,
}
parent.list_tags_for_resource(**kwargs)
list_work_groups
Lists available workgroups for the account.
Type annotations and code completion for session.client("athena").list_work_groups
method.
boto3 documentation
await def list_work_groups(
self,
*,
NextToken: str = ...,
MaxResults: int = ...,
) -> ListWorkGroupsOutputTypeDef: # (1)
...
kwargs: ListWorkGroupsInputRequestTypeDef = { # (1)
"NextToken": ...,
}
parent.list_work_groups(**kwargs)
start_query_execution
Runs the SQL query statements contained in the Query
.
Type annotations and code completion for session.client("athena").start_query_execution
method.
boto3 documentation
await def start_query_execution(
self,
*,
QueryString: str,
ClientRequestToken: str = ...,
QueryExecutionContext: QueryExecutionContextTypeDef = ..., # (1)
ResultConfiguration: ResultConfigurationTypeDef = ..., # (2)
WorkGroup: str = ...,
ExecutionParameters: Sequence[str] = ...,
) -> StartQueryExecutionOutputTypeDef: # (3)
...
- See QueryExecutionContextTypeDef
- See ResultConfigurationTypeDef
- See StartQueryExecutionOutputTypeDef
kwargs: StartQueryExecutionInputRequestTypeDef = { # (1)
"QueryString": ...,
}
parent.start_query_execution(**kwargs)
stop_query_execution
Stops a query execution.
Type annotations and code completion for session.client("athena").stop_query_execution
method.
boto3 documentation
await def stop_query_execution(
self,
*,
QueryExecutionId: str,
) -> Dict[str, Any]:
...
kwargs: StopQueryExecutionInputRequestTypeDef = { # (1)
"QueryExecutionId": ...,
}
parent.stop_query_execution(**kwargs)
tag_resource
Adds one or more tags to an Athena resource.
Type annotations and code completion for session.client("athena").tag_resource
method.
boto3 documentation
await def tag_resource(
self,
*,
ResourceARN: str,
Tags: Sequence[TagTypeDef], # (1)
) -> Dict[str, Any]:
...
- See TagTypeDef
kwargs: TagResourceInputRequestTypeDef = { # (1)
"ResourceARN": ...,
"Tags": ...,
}
parent.tag_resource(**kwargs)
untag_resource
Removes one or more tags from a data catalog or workgroup resource.
Type annotations and code completion for session.client("athena").untag_resource
method.
boto3 documentation
await def untag_resource(
self,
*,
ResourceARN: str,
TagKeys: Sequence[str],
) -> Dict[str, Any]:
...
kwargs: UntagResourceInputRequestTypeDef = { # (1)
"ResourceARN": ...,
"TagKeys": ...,
}
parent.untag_resource(**kwargs)
update_data_catalog
Updates the data catalog that has the specified name.
Type annotations and code completion for session.client("athena").update_data_catalog
method.
boto3 documentation
await def update_data_catalog(
self,
*,
Name: str,
Type: DataCatalogTypeType, # (1)
Description: str = ...,
Parameters: Mapping[str, str] = ...,
) -> Dict[str, Any]:
...
kwargs: UpdateDataCatalogInputRequestTypeDef = { # (1)
"Name": ...,
"Type": ...,
}
parent.update_data_catalog(**kwargs)
update_named_query
Updates a NamedQuery object.
Type annotations and code completion for session.client("athena").update_named_query
method.
boto3 documentation
await def update_named_query(
self,
*,
NamedQueryId: str,
Name: str,
QueryString: str,
Description: str = ...,
) -> Dict[str, Any]:
...
kwargs: UpdateNamedQueryInputRequestTypeDef = { # (1)
"NamedQueryId": ...,
"Name": ...,
"QueryString": ...,
}
parent.update_named_query(**kwargs)
update_prepared_statement
Updates a prepared statement.
Type annotations and code completion for session.client("athena").update_prepared_statement
method.
boto3 documentation
await def update_prepared_statement(
self,
*,
StatementName: str,
WorkGroup: str,
QueryStatement: str,
Description: str = ...,
) -> Dict[str, Any]:
...
kwargs: UpdatePreparedStatementInputRequestTypeDef = { # (1)
"StatementName": ...,
"WorkGroup": ...,
"QueryStatement": ...,
}
parent.update_prepared_statement(**kwargs)
update_work_group
Updates the workgroup with the specified name.
Type annotations and code completion for session.client("athena").update_work_group
method.
boto3 documentation
await def update_work_group(
self,
*,
WorkGroup: str,
Description: str = ...,
ConfigurationUpdates: WorkGroupConfigurationUpdatesTypeDef = ..., # (1)
State: WorkGroupStateType = ..., # (2)
) -> Dict[str, Any]:
...
kwargs: UpdateWorkGroupInputRequestTypeDef = { # (1)
"WorkGroup": ...,
}
parent.update_work_group(**kwargs)
__aenter__
Type annotations and code completion for session.client("athena").__aenter__
method.
boto3 documentation
__aexit__
Type annotations and code completion for session.client("athena").__aexit__
method.
boto3 documentation
get_paginator
Type annotations and code completion for session.client("athena").get_paginator
method with overloads.
client.get_paginator("get_query_results")
-> GetQueryResultsPaginatorclient.get_paginator("list_data_catalogs")
-> ListDataCatalogsPaginatorclient.get_paginator("list_databases")
-> ListDatabasesPaginatorclient.get_paginator("list_named_queries")
-> ListNamedQueriesPaginatorclient.get_paginator("list_query_executions")
-> ListQueryExecutionsPaginatorclient.get_paginator("list_table_metadata")
-> ListTableMetadataPaginatorclient.get_paginator("list_tags_for_resource")
-> ListTagsForResourcePaginator