Athena ****** Client ====== class Athena.Client A low-level client representing Amazon Athena Amazon Athena is an interactive query service that lets you use standard SQL to analyze data directly in Amazon S3. You can point Athena at your data in Amazon S3 and run ad-hoc queries and get results in seconds. Athena is serverless, so there is no infrastructure to set up or manage. You pay only for the queries you run. Athena scales automatically—executing queries in parallel—so results are fast, even with large datasets and complex queries. For more information, see What is Amazon Athena in the *Amazon Athena User Guide*. If you connect to Athena using the JDBC driver, use version 1.1.0 of the driver or later with the Amazon Athena API. Earlier version drivers do not support the API. For more information and to download the driver, see Accessing Amazon Athena with JDBC. import boto3 client = boto3.client('athena') These are the available methods: * batch_get_named_query * batch_get_prepared_statement * batch_get_query_execution * can_paginate * cancel_capacity_reservation * close * create_capacity_reservation * create_data_catalog * create_named_query * create_notebook * create_prepared_statement * create_presigned_notebook_url * create_work_group * delete_capacity_reservation * delete_data_catalog * delete_named_query * delete_notebook * delete_prepared_statement * delete_work_group * export_notebook * get_calculation_execution * get_calculation_execution_code * get_calculation_execution_status * get_capacity_assignment_configuration * get_capacity_reservation * get_data_catalog * get_database * get_named_query * get_notebook_metadata * get_paginator * get_prepared_statement * get_query_execution * get_query_results * get_query_runtime_statistics * get_session * get_session_status * get_table_metadata * get_waiter * get_work_group * import_notebook * list_application_dpu_sizes * list_calculation_executions * list_capacity_reservations * list_data_catalogs * list_databases * list_engine_versions * list_executors * list_named_queries * list_notebook_metadata * list_notebook_sessions * list_prepared_statements * list_query_executions * list_sessions * list_table_metadata * list_tags_for_resource * list_work_groups * put_capacity_assignment_configuration * start_calculation_execution * start_query_execution * start_session * stop_calculation_execution * stop_query_execution * tag_resource * terminate_session * untag_resource * update_capacity_reservation * update_data_catalog * update_named_query * update_notebook * update_notebook_metadata * update_prepared_statement * update_work_group Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * GetQueryResults * ListDataCatalogs * ListDatabases * ListNamedQueries * ListQueryExecutions * ListTableMetadata * ListTagsForResource Athena / Paginator / ListTagsForResource ListTagsForResource ******************* class Athena.Paginator.ListTagsForResource paginator = client.get_paginator('list_tags_for_resource') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_tags_for_resource()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( ResourceARN='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **ResourceARN** (*string*) -- **[REQUIRED]** Lists the tags for the resource with the specified ARN. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], } **Response Structure** * *(dict) --* * **Tags** *(list) --* The list of tags associated with the specified resource. * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case- sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case- sensitive. Athena / Paginator / ListTableMetadata ListTableMetadata ***************** class Athena.Paginator.ListTableMetadata paginator = client.get_paginator('list_table_metadata') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_table_metadata()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( CatalogName='string', DatabaseName='string', Expression='string', WorkGroup='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog for which table metadata should be returned. * **DatabaseName** (*string*) -- **[REQUIRED]** The name of the database for which table metadata should be returned. * **Expression** (*string*) -- A regex filter that pattern- matches table names. If no expression is supplied, metadata for all tables are listed. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'TableMetadataList': [ { 'Name': 'string', 'CreateTime': datetime(2015, 1, 1), 'LastAccessTime': datetime(2015, 1, 1), 'TableType': 'string', 'Columns': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'PartitionKeys': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'Parameters': { 'string': 'string' } }, ], } **Response Structure** * *(dict) --* * **TableMetadataList** *(list) --* A list of table metadata. * *(dict) --* Contains metadata for a table. * **Name** *(string) --* The name of the table. * **CreateTime** *(datetime) --* The time that the table was created. * **LastAccessTime** *(datetime) --* The last time the table was accessed. * **TableType** *(string) --* The type of table. In Athena, only "EXTERNAL_TABLE" is supported. * **Columns** *(list) --* A list of the columns in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **PartitionKeys** *(list) --* A list of the partition keys in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **Parameters** *(dict) --* A set of custom key/value pairs for table properties. * *(string) --* * *(string) --* Athena / Paginator / ListNamedQueries ListNamedQueries **************** class Athena.Paginator.ListNamedQueries paginator = client.get_paginator('list_named_queries') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_named_queries()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( WorkGroup='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **WorkGroup** (*string*) -- The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'NamedQueryIds': [ 'string', ], } **Response Structure** * *(dict) --* * **NamedQueryIds** *(list) --* The list of unique query IDs. * *(string) --* Athena / Paginator / ListDataCatalogs ListDataCatalogs **************** class Athena.Paginator.ListDataCatalogs paginator = client.get_paginator('list_data_catalogs') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_data_catalogs()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( WorkGroup='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **WorkGroup** (*string*) -- The name of the workgroup. Required if making an IAM Identity Center request. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'DataCatalogsSummary': [ { 'CatalogName': 'string', 'Type': 'LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', 'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED', 'ConnectionType': 'DYNAMODB'|'MYSQL'|'POSTGRESQL'|'REDSHIFT'|'ORACLE'|'SYNAPSE'|'SQLSERVER'|'DB2'|'OPENSEARCH'|'BIGQUERY'|'GOOGLECLOUDSTORAGE'|'HBASE'|'DOCUMENTDB'|'CMDB'|'TPCDS'|'TIMESTREAM'|'SAPHANA'|'SNOWFLAKE'|'DATALAKEGEN2'|'DB2AS400', 'Error': 'string' }, ], } **Response Structure** * *(dict) --* * **DataCatalogsSummary** *(list) --* A summary list of data catalogs. * *(dict) --* The summary information for the data catalog, which includes its name and type. * **CatalogName** *(string) --* The name of the data catalog. The catalog name is unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Type** *(string) --* The data catalog type. * **Status** *(string) --* The status of the creation or deletion of the data catalog. * The "LAMBDA", "GLUE", and "HIVE" data catalog types are created synchronously. Their status is either "CREATE_COMPLETE" or "CREATE_FAILED". * The "FEDERATED" data catalog type is created asynchronously. Data catalog creation status: * "CREATE_IN_PROGRESS": Federated data catalog creation in progress. * "CREATE_COMPLETE": Data catalog creation complete. * "CREATE_FAILED": Data catalog could not be created. * "CREATE_FAILED_CLEANUP_IN_PROGRESS": Federated data catalog creation failed and is being removed. * "CREATE_FAILED_CLEANUP_COMPLETE": Federated data catalog creation failed and was removed. * "CREATE_FAILED_CLEANUP_FAILED": Federated data catalog creation failed but could not be removed. Data catalog deletion status: * "DELETE_IN_PROGRESS": Federated data catalog deletion in progress. * "DELETE_COMPLETE": Federated data catalog deleted. * "DELETE_FAILED": Federated data catalog could not be deleted. * **ConnectionType** *(string) --* The type of connection for a "FEDERATED" data catalog (for example, "REDSHIFT", "MYSQL", or "SQLSERVER"). For information about individual connectors, see Available data source connectors. * **Error** *(string) --* Text of the error that occurred during data catalog creation or deletion. Athena / Paginator / ListDatabases ListDatabases ************* class Athena.Paginator.ListDatabases paginator = client.get_paginator('list_databases') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_databases()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( CatalogName='string', WorkGroup='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog that contains the databases to return. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'DatabaseList': [ { 'Name': 'string', 'Description': 'string', 'Parameters': { 'string': 'string' } }, ], } **Response Structure** * *(dict) --* * **DatabaseList** *(list) --* A list of databases from a data catalog. * *(dict) --* Contains metadata information for a database in a data catalog. * **Name** *(string) --* The name of the database. * **Description** *(string) --* An optional description of the database. * **Parameters** *(dict) --* A set of custom key/value pairs. * *(string) --* * *(string) --* Athena / Paginator / ListQueryExecutions ListQueryExecutions ******************* class Athena.Paginator.ListQueryExecutions paginator = client.get_paginator('list_query_executions') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.list_query_executions()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( WorkGroup='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **WorkGroup** (*string*) -- The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'QueryExecutionIds': [ 'string', ], } **Response Structure** * *(dict) --* * **QueryExecutionIds** *(list) --* The unique IDs of each query execution as an array of strings. * *(string) --* Athena / Paginator / GetQueryResults GetQueryResults *************** class Athena.Paginator.GetQueryResults paginator = client.get_paginator('get_query_results') paginate(**kwargs) Creates an iterator that will paginate through responses from "Athena.Client.get_query_results()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( QueryExecutionId='string', QueryResultType='DATA_MANIFEST'|'DATA_ROWS', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **QueryExecutionId** (*string*) -- **[REQUIRED]** The unique ID of the query execution. * **QueryResultType** (*string*) -- When you set this to "DATA_ROWS" or empty, "GetQueryResults" returns the query results in rows. If set to "DATA_MANIFEST", it returns the manifest file in rows. Only the query types "CREATE TABLE AS SELECT", "UNLOAD", and "INSERT" can generate a manifest file. If you use "DATA_MANIFEST" for other query types, the query will fail. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'UpdateCount': 123, 'ResultSet': { 'Rows': [ { 'Data': [ { 'VarCharValue': 'string' }, ] }, ], 'ResultSetMetadata': { 'ColumnInfo': [ { 'CatalogName': 'string', 'SchemaName': 'string', 'TableName': 'string', 'Name': 'string', 'Label': 'string', 'Type': 'string', 'Precision': 123, 'Scale': 123, 'Nullable': 'NOT_NULL'|'NULLABLE'|'UNKNOWN', 'CaseSensitive': True|False }, ] } }, } **Response Structure** * *(dict) --* * **UpdateCount** *(integer) --* The number of rows inserted with a "CREATE TABLE AS SELECT", "INSERT INTO", or "UPDATE" statement. * **ResultSet** *(dict) --* The results of the query execution. * **Rows** *(list) --* The rows in the table. * *(dict) --* The rows that make up a query result table. * **Data** *(list) --* The data that populates a row in a query result table. * *(dict) --* A piece of data (a field in the table). * **VarCharValue** *(string) --* The value of the datum. * **ResultSetMetadata** *(dict) --* The metadata that describes the column structure and data types of a table of query results. * **ColumnInfo** *(list) --* Information about the columns returned in a query result metadata. * *(dict) --* Information about the columns in a query execution result. * **CatalogName** *(string) --* The catalog to which the query results belong. * **SchemaName** *(string) --* The schema name (database name) to which the query results belong. * **TableName** *(string) --* The table name for the query results. * **Name** *(string) --* The name of the column. * **Label** *(string) --* A column label. * **Type** *(string) --* The data type of the column. * **Precision** *(integer) --* For "DECIMAL" data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits. * **Scale** *(integer) --* For "DECIMAL" data types, specifies the total number of digits in the fractional part of the value. Defaults to 0. * **Nullable** *(string) --* Unsupported constraint. This value always shows as "UNKNOWN". * **CaseSensitive** *(boolean) --* Indicates whether values in the column are case- sensitive. Athena / Client / delete_prepared_statement delete_prepared_statement ************************* Athena.Client.delete_prepared_statement(**kwargs) Deletes the prepared statement with the specified name from the specified workgroup. See also: AWS API Documentation **Request Syntax** response = client.delete_prepared_statement( StatementName='string', WorkGroup='string' ) Parameters: * **StatementName** (*string*) -- **[REQUIRED]** The name of the prepared statement to delete. * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup to which the statement to be deleted belongs. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / list_work_groups list_work_groups **************** Athena.Client.list_work_groups(**kwargs) Lists available workgroups for the account. See also: AWS API Documentation **Request Syntax** response = client.list_work_groups( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of workgroups to return in this request. Return type: dict Returns: **Response Syntax** { 'WorkGroups': [ { 'Name': 'string', 'State': 'ENABLED'|'DISABLED', 'Description': 'string', 'CreationTime': datetime(2015, 1, 1), 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'IdentityCenterApplicationArn': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **WorkGroups** *(list) --* A list of WorkGroupSummary objects that include the names, descriptions, creation times, and states for each workgroup. * *(dict) --* The summary information for the workgroup, which includes its name, state, description, and the date and time it was created. * **Name** *(string) --* The name of the workgroup. * **State** *(string) --* The state of the workgroup. * **Description** *(string) --* The workgroup description. * **CreationTime** *(datetime) --* The workgroup creation date and time. * **EngineVersion** *(dict) --* The engine version setting for all queries on the workgroup. Queries on the "AmazonAthenaPreviewFunctionality" workgroup run on the preview engine regardless of this setting. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **IdentityCenterApplicationArn** *(string) --* The ARN of the IAM Identity Center enabled application associated with the workgroup. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_paginator get_paginator ************* Athena.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. Athena / Client / get_table_metadata get_table_metadata ****************** Athena.Client.get_table_metadata(**kwargs) Returns table metadata for the specified catalog, database, and table. See also: AWS API Documentation **Request Syntax** response = client.get_table_metadata( CatalogName='string', DatabaseName='string', TableName='string', WorkGroup='string' ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog that contains the database and table metadata to return. * **DatabaseName** (*string*) -- **[REQUIRED]** The name of the database that contains the table metadata to return. * **TableName** (*string*) -- **[REQUIRED]** The name of the table for which metadata is returned. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. Return type: dict Returns: **Response Syntax** { 'TableMetadata': { 'Name': 'string', 'CreateTime': datetime(2015, 1, 1), 'LastAccessTime': datetime(2015, 1, 1), 'TableType': 'string', 'Columns': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'PartitionKeys': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'Parameters': { 'string': 'string' } } } **Response Structure** * *(dict) --* * **TableMetadata** *(dict) --* An object that contains table metadata. * **Name** *(string) --* The name of the table. * **CreateTime** *(datetime) --* The time that the table was created. * **LastAccessTime** *(datetime) --* The last time the table was accessed. * **TableType** *(string) --* The type of table. In Athena, only "EXTERNAL_TABLE" is supported. * **Columns** *(list) --* A list of the columns in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **PartitionKeys** *(list) --* A list of the partition keys in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **Parameters** *(dict) --* A set of custom key/value pairs for table properties. * *(string) --* * *(string) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.MetadataException" Athena / Client / list_calculation_executions list_calculation_executions *************************** Athena.Client.list_calculation_executions(**kwargs) Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later. See also: AWS API Documentation **Request Syntax** response = client.list_calculation_executions( SessionId='string', StateFilter='CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED', MaxResults=123, NextToken='string' ) Parameters: * **SessionId** (*string*) -- **[REQUIRED]** The session ID. * **StateFilter** (*string*) -- A filter for a specific calculation execution state. A description of each state follows. "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. * **MaxResults** (*integer*) -- The maximum number of calculation executions to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'Calculations': [ { 'CalculationExecutionId': 'string', 'Description': 'string', 'Status': { 'SubmissionDateTime': datetime(2015, 1, 1), 'CompletionDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED', 'StateChangeReason': 'string' } }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **Calculations** *(list) --* A list of CalculationSummary objects. * *(dict) --* Summary information for a notebook calculation. * **CalculationExecutionId** *(string) --* The calculation execution UUID. * **Description** *(string) --* A description of the calculation. * **Status** *(dict) --* Contains information about the status of the calculation. * **SubmissionDateTime** *(datetime) --* The date and time the calculation was submitted for processing. * **CompletionDateTime** *(datetime) --* The date and time the calculation completed processing. * **State** *(string) --* The state of the calculation execution. A description of each state follows. "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. * **StateChangeReason** *(string) --* The reason for the calculation state change (for example, the calculation was canceled because the session was terminated). **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_query_runtime_statistics get_query_runtime_statistics **************************** Athena.Client.get_query_runtime_statistics(**kwargs) 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. Statistics from the "Timeline" section of the response object are available as soon as QueryExecutionStatus$State is in a SUCCEEDED or FAILED state. The remaining non-timeline statistics in the response (like stage-level input and output row count and data size) are updated asynchronously and may not be available immediately after a query completes. The non-timeline statistics are also not included when a query has row-level filters defined in Lake Formation. See also: AWS API Documentation **Request Syntax** response = client.get_query_runtime_statistics( QueryExecutionId='string' ) Parameters: **QueryExecutionId** (*string*) -- **[REQUIRED]** The unique ID of the query execution. Return type: dict Returns: **Response Syntax** { 'QueryRuntimeStatistics': { 'Timeline': { 'QueryQueueTimeInMillis': 123, 'ServicePreProcessingTimeInMillis': 123, 'QueryPlanningTimeInMillis': 123, 'EngineExecutionTimeInMillis': 123, 'ServiceProcessingTimeInMillis': 123, 'TotalExecutionTimeInMillis': 123 }, 'Rows': { 'InputRows': 123, 'InputBytes': 123, 'OutputBytes': 123, 'OutputRows': 123 }, 'OutputStage': { 'StageId': 123, 'State': 'string', 'OutputBytes': 123, 'OutputRows': 123, 'InputBytes': 123, 'InputRows': 123, 'ExecutionTime': 123, 'QueryStagePlan': { 'Name': 'string', 'Identifier': 'string', 'Children': [ {'... recursive ...'}, ], 'RemoteSources': [ 'string', ] }, 'SubStages': [ {'... recursive ...'}, ] } } } **Response Structure** * *(dict) --* * **QueryRuntimeStatistics** *(dict) --* Runtime statistics about the query execution. * **Timeline** *(dict) --* Timeline statistics such as query queue time, planning time, execution time, service processing time, and total execution time. * **QueryQueueTimeInMillis** *(integer) --* The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue. * **ServicePreProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena spends on preprocessing before it submits the query to the engine. * **QueryPlanningTimeInMillis** *(integer) --* The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time. * **EngineExecutionTimeInMillis** *(integer) --* The number of milliseconds that the query took to execute. * **ServiceProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query. * **TotalExecutionTimeInMillis** *(integer) --* The number of milliseconds that Athena took to run the query. * **Rows** *(dict) --* Statistics such as input rows and bytes read by the query, rows and bytes output by the query, and the number of rows written by the query. * **InputRows** *(integer) --* The number of rows read to execute the query. * **InputBytes** *(integer) --* The number of bytes read to execute the query. * **OutputBytes** *(integer) --* The number of bytes returned by the query. * **OutputRows** *(integer) --* The number of rows returned by the query. * **OutputStage** *(dict) --* Stage statistics such as input and output rows and bytes, execution time, and stage state. This information also includes substages and the query stage plan. * **StageId** *(integer) --* The identifier for a stage. * **State** *(string) --* State of the stage after query execution. * **OutputBytes** *(integer) --* The number of bytes output from the stage after execution. * **OutputRows** *(integer) --* The number of rows output from the stage after execution. * **InputBytes** *(integer) --* The number of bytes input into the stage for execution. * **InputRows** *(integer) --* The number of rows input into the stage for execution. * **ExecutionTime** *(integer) --* Time taken to execute this stage. * **QueryStagePlan** *(dict) --* Stage plan information such as name, identifier, sub plans, and source stages. * **Name** *(string) --* Name of the query stage plan that describes the operation this stage is performing as part of query execution. * **Identifier** *(string) --* Information about the operation this query stage plan node is performing. * **Children** *(list) --* Stage plan information such as name, identifier, sub plans, and remote sources of child plan nodes/ * *(dict) --* Stage plan information such as name, identifier, sub plans, and remote sources. * **RemoteSources** *(list) --* Source plan node IDs. * *(string) --* * **SubStages** *(list) --* List of sub query stages that form this stage execution plan. * *(dict) --* Stage statistics such as input and output rows and bytes, execution time and stage state. This information also includes substages and the query stage plan. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / import_notebook import_notebook *************** Athena.Client.import_notebook(**kwargs) Imports a single "ipynb" file to a Spark enabled workgroup. To import the notebook, the request must specify a value for either "Payload" or "NoteBookS3LocationUri". If neither is specified or both are specified, an "InvalidRequestException" occurs. The maximum file size that can be imported is 10 megabytes. If an "ipynb" file with the same name already exists in the workgroup, throws an error. See also: AWS API Documentation **Request Syntax** response = client.import_notebook( WorkGroup='string', Name='string', Payload='string', Type='IPYNB', NotebookS3LocationUri='string', ClientRequestToken='string' ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The name of the Spark enabled workgroup to import the notebook to. * **Name** (*string*) -- **[REQUIRED]** The name of the notebook to import. * **Payload** (*string*) -- The notebook content to be imported. The payload must be in "ipynb" format. * **Type** (*string*) -- **[REQUIRED]** The notebook content type. Currently, the only valid type is "IPYNB". * **NotebookS3LocationUri** (*string*) -- A URI that specifies the Amazon S3 location of a notebook file in "ipynb" format. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to import the notebook is idempotent (executes only once). Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. Return type: dict Returns: **Response Syntax** { 'NotebookId': 'string' } **Response Structure** * *(dict) --* * **NotebookId** *(string) --* The ID assigned to the imported notebook. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / delete_work_group delete_work_group ***************** Athena.Client.delete_work_group(**kwargs) Deletes the workgroup with the specified name. The primary workgroup cannot be deleted. See also: AWS API Documentation **Request Syntax** response = client.delete_work_group( WorkGroup='string', RecursiveDeleteOption=True|False ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The unique name of the workgroup to delete. * **RecursiveDeleteOption** (*boolean*) -- The option to delete the workgroup and its contents even if the workgroup contains any named queries, query executions, or notebooks. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_calculation_execution_status get_calculation_execution_status ******************************** Athena.Client.get_calculation_execution_status(**kwargs) Gets the status of a current calculation. See also: AWS API Documentation **Request Syntax** response = client.get_calculation_execution_status( CalculationExecutionId='string' ) Parameters: **CalculationExecutionId** (*string*) -- **[REQUIRED]** The calculation execution UUID. Return type: dict Returns: **Response Syntax** { 'Status': { 'SubmissionDateTime': datetime(2015, 1, 1), 'CompletionDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED', 'StateChangeReason': 'string' }, 'Statistics': { 'DpuExecutionInMillis': 123, 'Progress': 'string' } } **Response Structure** * *(dict) --* * **Status** *(dict) --* Contains information about the calculation execution status. * **SubmissionDateTime** *(datetime) --* The date and time the calculation was submitted for processing. * **CompletionDateTime** *(datetime) --* The date and time the calculation completed processing. * **State** *(string) --* The state of the calculation execution. A description of each state follows. "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. * **StateChangeReason** *(string) --* The reason for the calculation state change (for example, the calculation was canceled because the session was terminated). * **Statistics** *(dict) --* Contains information about the DPU execution time and progress. * **DpuExecutionInMillis** *(integer) --* The data processing unit execution time in milliseconds for the calculation. * **Progress** *(string) --* The progress of the calculation. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / update_named_query update_named_query ****************** Athena.Client.update_named_query(**kwargs) Updates a NamedQuery object. The database or workgroup cannot be updated. See also: AWS API Documentation **Request Syntax** response = client.update_named_query( NamedQueryId='string', Name='string', Description='string', QueryString='string' ) Parameters: * **NamedQueryId** (*string*) -- **[REQUIRED]** The unique identifier (UUID) of the query. * **Name** (*string*) -- **[REQUIRED]** The name of the query. * **Description** (*string*) -- The query description. * **QueryString** (*string*) -- **[REQUIRED]** The contents of the query with all query statements. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / can_paginate can_paginate ************ Athena.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. Athena / Client / batch_get_query_execution batch_get_query_execution ************************* Athena.Client.batch_get_query_execution(**kwargs) 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. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use ListQueryExecutionsInput$WorkGroup. Query executions differ from named (saved) queries. Use BatchGetNamedQueryInput to get details about named queries. See also: AWS API Documentation **Request Syntax** response = client.batch_get_query_execution( QueryExecutionIds=[ 'string', ] ) Parameters: **QueryExecutionIds** (*list*) -- **[REQUIRED]** An array of query execution IDs. * *(string) --* Return type: dict Returns: **Response Syntax** { 'QueryExecutions': [ { 'QueryExecutionId': 'string', 'Query': 'string', 'StatementType': 'DDL'|'DML'|'UTILITY', 'ManagedQueryResultsConfiguration': { 'Enabled': True|False, 'EncryptionConfiguration': { 'KmsKey': 'string' } }, 'ResultConfiguration': { 'OutputLocation': 'string', 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'ExpectedBucketOwner': 'string', 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' } }, 'ResultReuseConfiguration': { 'ResultReuseByAgeConfiguration': { 'Enabled': True|False, 'MaxAgeInMinutes': 123 } }, 'QueryExecutionContext': { 'Database': 'string', 'Catalog': 'string' }, 'Status': { 'State': 'QUEUED'|'RUNNING'|'SUCCEEDED'|'FAILED'|'CANCELLED', 'StateChangeReason': 'string', 'SubmissionDateTime': datetime(2015, 1, 1), 'CompletionDateTime': datetime(2015, 1, 1), 'AthenaError': { 'ErrorCategory': 123, 'ErrorType': 123, 'Retryable': True|False, 'ErrorMessage': 'string' } }, 'Statistics': { 'EngineExecutionTimeInMillis': 123, 'DataScannedInBytes': 123, 'DataManifestLocation': 'string', 'TotalExecutionTimeInMillis': 123, 'QueryQueueTimeInMillis': 123, 'ServicePreProcessingTimeInMillis': 123, 'QueryPlanningTimeInMillis': 123, 'ServiceProcessingTimeInMillis': 123, 'ResultReuseInformation': { 'ReusedPreviousResult': True|False } }, 'WorkGroup': 'string', 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'ExecutionParameters': [ 'string', ], 'SubstatementType': 'string', 'QueryResultsS3AccessGrantsConfiguration': { 'EnableS3AccessGrants': True|False, 'CreateUserLevelPrefix': True|False, 'AuthenticationType': 'DIRECTORY_IDENTITY' } }, ], 'UnprocessedQueryExecutionIds': [ { 'QueryExecutionId': 'string', 'ErrorCode': 'string', 'ErrorMessage': 'string' }, ] } **Response Structure** * *(dict) --* * **QueryExecutions** *(list) --* Information about a query execution. * *(dict) --* Information about a single instance of a query execution. * **QueryExecutionId** *(string) --* The unique identifier for each query execution. * **Query** *(string) --* The SQL query statements which the query execution ran. * **StatementType** *(string) --* The type of query statement that was run. "DDL" indicates DDL query statements. "DML" indicates DML (Data Manipulation Language) query statements, such as "CREATE TABLE AS SELECT". "UTILITY" indicates query statements other than DDL and DML, such as "SHOW CREATE TABLE", or "DESCRIBE TABLE". * **ManagedQueryResultsConfiguration** *(dict) --* The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. * **Enabled** *(boolean) --* If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under "ResultConfiguration$OutputLocation". The default is false. A workgroup cannot have the "ResultConfiguration$OutputLocation" parameter when you set this field to true. * **EncryptionConfiguration** *(dict) --* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information. * **KmsKey** *(string) --* The ARN of an KMS key for encrypting managed query results. * **ResultConfiguration** *(dict) --* The location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **EncryptionOption** *(string) --* Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **S3AclOption** *(string) --* The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **ResultReuseConfiguration** *(dict) --* Specifies the query result reuse behavior that was used for the query. * **ResultReuseByAgeConfiguration** *(dict) --* Specifies whether previous query results are reused, and if so, their maximum age. * **Enabled** *(boolean) --* True if previous query results can be reused when the query is run; otherwise, false. The default is false. * **MaxAgeInMinutes** *(integer) --* Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. The default is 60. * **QueryExecutionContext** *(dict) --* The database in which the query execution occurred. * **Database** *(string) --* The name of the database used in the query execution. The database must exist in the catalog. * **Catalog** *(string) --* The name of the data catalog used in the query execution. * **Status** *(dict) --* The completion date, current state, submission time, and state change reason (if applicable) for the query execution. * **State** *(string) --* The state of query execution. "QUEUED" indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. "RUNNING" indicates that the query is in execution phase. "SUCCEEDED" indicates that the query completed without errors. "FAILED" indicates that the query experienced an error and did not complete processing. "CANCELLED" indicates that a user input interrupted query execution. Note: Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from "RUNNING" or "FAILED" to "QUEUED". * **StateChangeReason** *(string) --* Further detail about the status of the query. * **SubmissionDateTime** *(datetime) --* The date and time that the query was submitted. * **CompletionDateTime** *(datetime) --* The date and time that the query completed. * **AthenaError** *(dict) --* Provides information about an Athena query error. * **ErrorCategory** *(integer) --* An integer value that specifies the category of a query failure error. The following list shows the category for each integer value. **1** - System **2** - User **3** - Other * **ErrorType** *(integer) --* An integer value that provides specific information about an Athena query error. For the meaning of specific values, see the Error Type Reference in the *Amazon Athena User Guide*. * **Retryable** *(boolean) --* True if the query might succeed if resubmitted. * **ErrorMessage** *(string) --* Contains a short description of the error that occurred. * **Statistics** *(dict) --* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run. * **EngineExecutionTimeInMillis** *(integer) --* The number of milliseconds that the query took to execute. * **DataScannedInBytes** *(integer) --* The number of bytes in the data that was queried. * **DataManifestLocation** *(string) --* The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see Working with Query Results, Output Files, and Query History in the *Amazon Athena User Guide*. * **TotalExecutionTimeInMillis** *(integer) --* The number of milliseconds that Athena took to run the query. * **QueryQueueTimeInMillis** *(integer) --* The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue. * **ServicePreProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena took to preprocess the query before submitting the query to the query engine. * **QueryPlanningTimeInMillis** *(integer) --* The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time. * **ServiceProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query. * **ResultReuseInformation** *(dict) --* Contains information about whether previous query results were reused for the query. * **ReusedPreviousResult** *(boolean) --* True if a previous query result was reused; false if the result was generated from a new run of the query. * **WorkGroup** *(string) --* The name of the workgroup in which the query ran. * **EngineVersion** *(dict) --* The engine version that executed the query. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **ExecutionParameters** *(list) --* A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur. The list of parameters is not returned in the response. * *(string) --* * **SubstatementType** *(string) --* The kind of query statement that was run. * **QueryResultsS3AccessGrantsConfiguration** *(dict) --* Specifies whether Amazon S3 access grants are enabled for query results. * **EnableS3AccessGrants** *(boolean) --* Specifies whether Amazon S3 access grants are enabled for query results. * **CreateUserLevelPrefix** *(boolean) --* When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location. * **AuthenticationType** *(string) --* The authentication type used for Amazon S3 access grants. Currently, only "DIRECTORY_IDENTITY" is supported. * **UnprocessedQueryExecutionIds** *(list) --* Information about the query executions that failed to run. * *(dict) --* Describes a query execution that failed to process. * **QueryExecutionId** *(string) --* The unique identifier of the query execution. * **ErrorCode** *(string) --* The error code returned when the query execution failed to process, if applicable. * **ErrorMessage** *(string) --* The error message returned when the query execution failed to process, if applicable. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / update_work_group update_work_group ***************** Athena.Client.update_work_group(**kwargs) Updates the workgroup with the specified name. The workgroup's name cannot be changed. Only "ConfigurationUpdates" can be specified. See also: AWS API Documentation **Request Syntax** response = client.update_work_group( WorkGroup='string', Description='string', ConfigurationUpdates={ 'EnforceWorkGroupConfiguration': True|False, 'ResultConfigurationUpdates': { 'OutputLocation': 'string', 'RemoveOutputLocation': True|False, 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'RemoveEncryptionConfiguration': True|False, 'ExpectedBucketOwner': 'string', 'RemoveExpectedBucketOwner': True|False, 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' }, 'RemoveAclConfiguration': True|False }, 'ManagedQueryResultsConfigurationUpdates': { 'Enabled': True|False, 'EncryptionConfiguration': { 'KmsKey': 'string' }, 'RemoveEncryptionConfiguration': True|False }, 'PublishCloudWatchMetricsEnabled': True|False, 'BytesScannedCutoffPerQuery': 123, 'RemoveBytesScannedCutoffPerQuery': True|False, 'RequesterPaysEnabled': True|False, 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'RemoveCustomerContentEncryptionConfiguration': True|False, 'AdditionalConfiguration': 'string', 'ExecutionRole': 'string', 'CustomerContentEncryptionConfiguration': { 'KmsKey': 'string' }, 'EnableMinimumEncryptionConfiguration': True|False, 'QueryResultsS3AccessGrantsConfiguration': { 'EnableS3AccessGrants': True|False, 'CreateUserLevelPrefix': True|False, 'AuthenticationType': 'DIRECTORY_IDENTITY' } }, State='ENABLED'|'DISABLED' ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The specified workgroup that will be updated. * **Description** (*string*) -- The workgroup description. * **ConfigurationUpdates** (*dict*) -- Contains configuration updates for an Athena SQL workgroup. * **EnforceWorkGroupConfiguration** *(boolean) --* If set to "true", the settings for the workgroup override client-side settings. If set to "false" client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings. * **ResultConfigurationUpdates** *(dict) --* The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The "workgroup settings override" is specified in "EnforceWorkGroupConfiguration" (true/false) in the "WorkGroupConfiguration". See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **RemoveOutputLocation** *(boolean) --* If set to "true", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the "OutputLocation" in "ResultConfigurationUpdates" (the client-side setting), the "OutputLocation" in the workgroup's "ResultConfiguration" will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings. * **EncryptionConfiguration** *(dict) --* The encryption configuration for query and calculation results. * **EncryptionOption** *(string) --* **[REQUIRED]** Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **RemoveEncryptionConfiguration** *(boolean) --* If set to "true", indicates that the previously-specified encryption configuration (also known as the client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the "EncryptionConfiguration" in "ResultConfigurationUpdates" (the client-side setting), the "EncryptionConfiguration" in the workgroup's "ResultConfiguration" will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **RemoveExpectedBucketOwner** *(boolean) --* If set to "true", removes the Amazon Web Services account ID previously specified for ResultConfiguration$ExpectedBucketOwner. If set to "false" or not set, and a value is present in the "ExpectedBucketOwner" in "ResultConfigurationUpdates" (the client-side setting), the "ExpectedBucketOwner" in the workgroup's "ResultConfiguration" is updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* The ACL configuration for the query results. * **S3AclOption** *(string) --* **[REQUIRED]** The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **RemoveAclConfiguration** *(boolean) --* If set to "true", indicates that the previously-specified ACL configuration for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the "AclConfiguration" of "ResultConfigurationUpdates", the "AclConfiguration" in the workgroup's "ResultConfiguration" is updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings. * **ManagedQueryResultsConfigurationUpdates** *(dict) --* Updates configuration information for managed query results in the workgroup. * **Enabled** *(boolean) --* If set to true, specifies that Athena manages query results in Athena owned storage. * **EncryptionConfiguration** *(dict) --* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information. * **KmsKey** *(string) --* **[REQUIRED]** The ARN of an KMS key for encrypting managed query results. * **RemoveEncryptionConfiguration** *(boolean) --* If set to true, it removes workgroup from Athena owned storage. The existing query results are cleaned up after 24hrs. You must provide query results in location specified under "ResultConfiguration$OutputLocation". * **PublishCloudWatchMetricsEnabled** *(boolean) --* Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch. * **BytesScannedCutoffPerQuery** *(integer) --* The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. * **RemoveBytesScannedCutoffPerQuery** *(boolean) --* Indicates that the data usage control limit per query is removed. WorkGroupConfiguration$BytesScannedCutoffPerQuery * **RequesterPaysEnabled** *(boolean) --* If set to "true", allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set to "false", workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is "false". For more information about Requester Pays buckets, see Requester Pays Buckets in the *Amazon Simple Storage Service Developer Guide*. * **EngineVersion** *(dict) --* The engine version requested when a workgroup is updated. After the update, all queries on the workgroup run on the requested engine version. If no value was previously set, the default is Auto. Queries on the "AmazonAthenaPreviewFunctionality" workgroup run on the preview engine regardless of this setting. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **RemoveCustomerContentEncryptionConfiguration** *(boolean) --* Removes content encryption configuration from an Apache Spark-enabled Athena workgroup. * **AdditionalConfiguration** *(string) --* Contains a user defined string in JSON format for a Spark- enabled workgroup. * **ExecutionRole** *(string) --* The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups. * **CustomerContentEncryptionConfiguration** *(dict) --* Specifies the customer managed KMS key that is used to encrypt the user's data stores in Athena. When an Amazon Web Services managed key is used, this value is null. This setting does not apply to Athena SQL workgroups. * **KmsKey** *(string) --* **[REQUIRED]** The customer managed KMS key that is used to encrypt the user's data stores in Athena. * **EnableMinimumEncryptionConfiguration** *(boolean) --* Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries. This setting does not apply to Spark-enabled workgroups. The "EnforceWorkGroupConfiguration" setting takes precedence over the "EnableMinimumEncryptionConfiguration" flag. This means that if "EnforceWorkGroupConfiguration" is true, the "EnableMinimumEncryptionConfiguration" flag is ignored, and the workgroup configuration for encryption is used. * **QueryResultsS3AccessGrantsConfiguration** *(dict) --* Specifies whether Amazon S3 access grants are enabled for query results. * **EnableS3AccessGrants** *(boolean) --* **[REQUIRED]** Specifies whether Amazon S3 access grants are enabled for query results. * **CreateUserLevelPrefix** *(boolean) --* When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location. * **AuthenticationType** *(string) --* **[REQUIRED]** The authentication type used for Amazon S3 access grants. Currently, only "DIRECTORY_IDENTITY" is supported. * **State** (*string*) -- The workgroup state that will be updated for the given workgroup. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_query_results get_query_results ***************** Athena.Client.get_query_results(**kwargs) Streams the results of a single query execution specified by "QueryExecutionId" from the Athena query results location in Amazon S3. For more information, see Working with query results, recent queries, and output files in the *Amazon Athena User Guide*. This request does not execute the query but returns results. Use StartQueryExecution to run a query. To stream query results successfully, the IAM principal with permission to call "GetQueryResults" also must have permissions to the Amazon S3 "GetObject" action for the Athena query results location. Warning: IAM principals with permission to the Amazon S3 "GetObject" action for the query results location are able to retrieve query results from Amazon S3 even if permission to the "GetQueryResults" action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied. See also: AWS API Documentation **Request Syntax** response = client.get_query_results( QueryExecutionId='string', NextToken='string', MaxResults=123, QueryResultType='DATA_MANIFEST'|'DATA_ROWS' ) Parameters: * **QueryExecutionId** (*string*) -- **[REQUIRED]** The unique ID of the query execution. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of results (rows) to return in this request. * **QueryResultType** (*string*) -- When you set this to "DATA_ROWS" or empty, "GetQueryResults" returns the query results in rows. If set to "DATA_MANIFEST", it returns the manifest file in rows. Only the query types "CREATE TABLE AS SELECT", "UNLOAD", and "INSERT" can generate a manifest file. If you use "DATA_MANIFEST" for other query types, the query will fail. Return type: dict Returns: **Response Syntax** { 'UpdateCount': 123, 'ResultSet': { 'Rows': [ { 'Data': [ { 'VarCharValue': 'string' }, ] }, ], 'ResultSetMetadata': { 'ColumnInfo': [ { 'CatalogName': 'string', 'SchemaName': 'string', 'TableName': 'string', 'Name': 'string', 'Label': 'string', 'Type': 'string', 'Precision': 123, 'Scale': 123, 'Nullable': 'NOT_NULL'|'NULLABLE'|'UNKNOWN', 'CaseSensitive': True|False }, ] } }, 'NextToken': 'string' } **Response Structure** * *(dict) --* * **UpdateCount** *(integer) --* The number of rows inserted with a "CREATE TABLE AS SELECT", "INSERT INTO", or "UPDATE" statement. * **ResultSet** *(dict) --* The results of the query execution. * **Rows** *(list) --* The rows in the table. * *(dict) --* The rows that make up a query result table. * **Data** *(list) --* The data that populates a row in a query result table. * *(dict) --* A piece of data (a field in the table). * **VarCharValue** *(string) --* The value of the datum. * **ResultSetMetadata** *(dict) --* The metadata that describes the column structure and data types of a table of query results. * **ColumnInfo** *(list) --* Information about the columns returned in a query result metadata. * *(dict) --* Information about the columns in a query execution result. * **CatalogName** *(string) --* The catalog to which the query results belong. * **SchemaName** *(string) --* The schema name (database name) to which the query results belong. * **TableName** *(string) --* The table name for the query results. * **Name** *(string) --* The name of the column. * **Label** *(string) --* A column label. * **Type** *(string) --* The data type of the column. * **Precision** *(integer) --* For "DECIMAL" data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits. * **Scale** *(integer) --* For "DECIMAL" data types, specifies the total number of digits in the fractional part of the value. Defaults to 0. * **Nullable** *(string) --* Unsupported constraint. This value always shows as "UNKNOWN". * **CaseSensitive** *(boolean) --* Indicates whether values in the column are case- sensitive. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / update_prepared_statement update_prepared_statement ************************* Athena.Client.update_prepared_statement(**kwargs) Updates a prepared statement. See also: AWS API Documentation **Request Syntax** response = client.update_prepared_statement( StatementName='string', WorkGroup='string', QueryStatement='string', Description='string' ) Parameters: * **StatementName** (*string*) -- **[REQUIRED]** The name of the prepared statement. * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup for the prepared statement. * **QueryStatement** (*string*) -- **[REQUIRED]** The query string for the prepared statement. * **Description** (*string*) -- The description of the prepared statement. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_notebook_metadata get_notebook_metadata ********************* Athena.Client.get_notebook_metadata(**kwargs) Retrieves notebook metadata for the specified notebook ID. See also: AWS API Documentation **Request Syntax** response = client.get_notebook_metadata( NotebookId='string' ) Parameters: **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook whose metadata is to be retrieved. Return type: dict Returns: **Response Syntax** { 'NotebookMetadata': { 'NotebookId': 'string', 'Name': 'string', 'WorkGroup': 'string', 'CreationTime': datetime(2015, 1, 1), 'Type': 'IPYNB', 'LastModifiedTime': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **NotebookMetadata** *(dict) --* The metadata that is returned for the specified notebook ID. * **NotebookId** *(string) --* The notebook ID. * **Name** *(string) --* The name of the notebook. * **WorkGroup** *(string) --* The name of the Spark enabled workgroup to which the notebook belongs. * **CreationTime** *(datetime) --* The time when the notebook was created. * **Type** *(string) --* The type of notebook. Currently, the only valid type is "IPYNB". * **LastModifiedTime** *(datetime) --* The time when the notebook was last modified. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / list_query_executions list_query_executions ********************* Athena.Client.list_query_executions(**kwargs) Provides a list of available query execution IDs for the queries in the specified workgroup. Athena keeps a query history for 45 days. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran. See also: AWS API Documentation **Request Syntax** response = client.list_query_executions( NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of query executions to return in this request. * **WorkGroup** (*string*) -- The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned. Return type: dict Returns: **Response Syntax** { 'QueryExecutionIds': [ 'string', ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **QueryExecutionIds** *(list) --* The unique IDs of each query execution as an array of strings. * *(string) --* * **NextToken** *(string) --* A token to be used by the next request if this request is truncated. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / put_capacity_assignment_configuration put_capacity_assignment_configuration ************************************* Athena.Client.put_capacity_assignment_configuration(**kwargs) Puts a new capacity assignment configuration for a specified capacity reservation. If a capacity assignment configuration already exists for the capacity reservation, replaces the existing capacity assignment configuration. See also: AWS API Documentation **Request Syntax** response = client.put_capacity_assignment_configuration( CapacityReservationName='string', CapacityAssignments=[ { 'WorkGroupNames': [ 'string', ] }, ] ) Parameters: * **CapacityReservationName** (*string*) -- **[REQUIRED]** The name of the capacity reservation to put a capacity assignment configuration for. * **CapacityAssignments** (*list*) -- **[REQUIRED]** The list of assignments for the capacity assignment configuration. * *(dict) --* A mapping between one or more workgroups and a capacity reservation. * **WorkGroupNames** *(list) --* The list of workgroup names for the capacity assignment. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / create_data_catalog create_data_catalog ******************* Athena.Client.create_data_catalog(**kwargs) Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same Amazon Web Services account. For a "FEDERATED" catalog, this API operation creates the following resources. * CFN Stack Name with a maximum length of 128 characters and prefix "athenafederatedcatalog-CATALOG_NAME_SANITIZED" with length 23 characters. * Lambda Function Name with a maximum length of 64 characters and prefix "athenafederatedcatalog_CATALOG_NAME_SANITIZED" with length 23 characters. * Glue Connection Name with a maximum length of 255 characters and a prefix "athenafederatedcatalog_CATALOG_NAME_SANITIZED" with length 23 characters. See also: AWS API Documentation **Request Syntax** response = client.create_data_catalog( Name='string', Type='LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', Description='string', Parameters={ 'string': 'string' }, Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. For "FEDERATED" type the catalog name has following considerations and limits: * The catalog name allows special characters such as >>``<<_ , @ , , - >>``<<. These characters are replaced with a hyphen (-) when creating the CFN Stack Name and with an underscore (_) when creating the Lambda Function and Glue Connection Name. * The catalog name has a theoretical limit of 128 characters. However, since we use it to create other resources that allow less characters and we prepend a prefix to it, the actual catalog name limit for "FEDERATED" catalog is 64 - 23 = 41 characters. * **Type** (*string*) -- **[REQUIRED]** The type of data catalog to create: "LAMBDA" for a federated catalog, "GLUE" for an Glue Data Catalog, and "HIVE" for an external Apache Hive metastore. "FEDERATED" is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass. For "FEDERATED" type, we do not support IAM identity center. * **Description** (*string*) -- A description of the data catalog to be created. * **Parameters** (*dict*) -- Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type. * For the "HIVE" data catalog type, use the following syntax. The "metadata-function" parameter is required. "The sdk- version" parameter is optional and defaults to the currently supported version. "metadata-function=lambda_arn, sdk- version=version_number" * For the "LAMBDA" data catalog type, use one of the following sets of required parameters, but not both. * If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required. "metadata- function=lambda_arn, record-function=lambda_arn" * If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function. "function=lambda_arn" * The "GLUE" type takes a catalog ID parameter and is required. The "catalog_id" is the account ID of the Amazon Web Services account to which the Glue Data Catalog belongs. "catalog-id=catalog_id" * The "GLUE" data catalog type also applies to the default "AwsDataCatalog" that already exists in your account, of which you can have only one and cannot modify. * The "FEDERATED" data catalog type uses one of the following parameters, but not both. Use "connection-arn" for an existing Glue connection. Use "connection-type" and "connection-properties" to specify the configuration setting for a new connection. * "connection-arn:" * "lambda-role-arn" (optional): The execution role to use for the Lambda function. If not provided, one is created. * "connection-type:MYSQL|REDSHIFT|...., connection- properties:""" For "" , use escaped JSON text, as in the following example. ""{\"spill_bucket\":\"my_spill\",\"spill_prefix \":\"athena-spill\",\"host\":\"abc12345.snowflakecomputin g.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\",\"data base\":\"TEST\",\"schema\":\"PUBLIC\",\"SecretArn\":\"arn :aws:secretsmanager:ap-south-1:111122223333:secret :snowflake-XHb67j\"}"" * *(string) --* * *(string) --* * **Tags** (*list*) -- A list of comma separated tags to add to the data catalog that is created. All the resources that are created by the "CreateDataCatalog" API operation with "FEDERATED" type will have the tag "federated_athena_datacatalog="true"". This includes the CFN Stack, Glue Connection, Athena DataCatalog, and all the resources created as part of the CFN Stack (Lambda Function, IAM policies/roles). * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. Return type: dict Returns: **Response Syntax** { 'DataCatalog': { 'Name': 'string', 'Description': 'string', 'Type': 'LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', 'Parameters': { 'string': 'string' }, 'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED', 'ConnectionType': 'DYNAMODB'|'MYSQL'|'POSTGRESQL'|'REDSHIFT'|'ORACLE'|'SYNAPSE'|'SQLSERVER'|'DB2'|'OPENSEARCH'|'BIGQUERY'|'GOOGLECLOUDSTORAGE'|'HBASE'|'DOCUMENTDB'|'CMDB'|'TPCDS'|'TIMESTREAM'|'SAPHANA'|'SNOWFLAKE'|'DATALAKEGEN2'|'DB2AS400', 'Error': 'string' } } **Response Structure** * *(dict) --* * **DataCatalog** *(dict) --* Contains information about a data catalog in an Amazon Web Services account. Note: In the Athena console, data catalogs are listed as "data sources" on the **Data sources** page under the **Data source name** column. * **Name** *(string) --* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Description** *(string) --* An optional description of the data catalog. * **Type** *(string) --* The type of data catalog to create: "LAMBDA" for a federated catalog, "GLUE" for an Glue Data Catalog, and "HIVE" for an external Apache Hive metastore. "FEDERATED" is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass. * **Parameters** *(dict) --* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type. * For the "HIVE" data catalog type, use the following syntax. The "metadata-function" parameter is required. "The sdk-version" parameter is optional and defaults to the currently supported version. "metadata- function=lambda_arn, sdk-version=version_number" * For the "LAMBDA" data catalog type, use one of the following sets of required parameters, but not both. * If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required. "metadata-function=lambda_arn, record- function=lambda_arn" * If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function. "function=lambda_arn" * The "GLUE" type takes a catalog ID parameter and is required. The "catalog_id" is the account ID of the Amazon Web Services account to which the Glue catalog belongs. "catalog-id=catalog_id" * The "GLUE" data catalog type also applies to the default "AwsDataCatalog" that already exists in your account, of which you can have only one and cannot modify. * The "FEDERATED" data catalog type uses one of the following parameters, but not both. Use "connection-arn" for an existing Glue connection. Use "connection-type" and "connection-properties" to specify the configuration setting for a new connection. * "connection-arn:" * "connection-type:MYSQL|REDSHIFT|...., connection- properties:""" For "" , use escaped JSON text, as in the following example. ""{\"spill_bucket\":\"my_spill\",\"spill_prefix \":\"athena-spill\",\"host\":\"abc12345.snowflakecomp uting.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\ ",\"database\":\"TEST\",\"schema\":\"PUBLIC\",\"Secre tArn\":\"arn:aws:secretsmanager:ap- south-1:111122223333:secret:snowflake-XHb67j\"}"" * *(string) --* * *(string) --* * **Status** *(string) --* The status of the creation or deletion of the data catalog. * The "LAMBDA", "GLUE", and "HIVE" data catalog types are created synchronously. Their status is either "CREATE_COMPLETE" or "CREATE_FAILED". * The "FEDERATED" data catalog type is created asynchronously. Data catalog creation status: * "CREATE_IN_PROGRESS": Federated data catalog creation in progress. * "CREATE_COMPLETE": Data catalog creation complete. * "CREATE_FAILED": Data catalog could not be created. * "CREATE_FAILED_CLEANUP_IN_PROGRESS": Federated data catalog creation failed and is being removed. * "CREATE_FAILED_CLEANUP_COMPLETE": Federated data catalog creation failed and was removed. * "CREATE_FAILED_CLEANUP_FAILED": Federated data catalog creation failed but could not be removed. Data catalog deletion status: * "DELETE_IN_PROGRESS": Federated data catalog deletion in progress. * "DELETE_COMPLETE": Federated data catalog deleted. * "DELETE_FAILED": Federated data catalog could not be deleted. * **ConnectionType** *(string) --* The type of connection for a "FEDERATED" data catalog (for example, "REDSHIFT", "MYSQL", or "SQLSERVER"). For information about individual connectors, see Available data source connectors. * **Error** *(string) --* Text of the error that occurred during data catalog creation or deletion. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / terminate_session terminate_session ***************** Athena.Client.terminate_session(**kwargs) Terminates an active session. A "TerminateSession" call on a session that is already inactive (for example, in a "FAILED", "TERMINATED" or "TERMINATING" state) succeeds but has no effect. Calculations running in the session when "TerminateSession" is called are forcefully stopped, but may display as "FAILED" instead of "STOPPED". See also: AWS API Documentation **Request Syntax** response = client.terminate_session( SessionId='string' ) Parameters: **SessionId** (*string*) -- **[REQUIRED]** The session ID. Return type: dict Returns: **Response Syntax** { 'State': 'CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED' } **Response Structure** * *(dict) --* * **State** *(string) --* The state of the session. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_data_catalog get_data_catalog **************** Athena.Client.get_data_catalog(**kwargs) Returns the specified data catalog. See also: AWS API Documentation **Request Syntax** response = client.get_data_catalog( Name='string', WorkGroup='string' ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the data catalog to return. * **WorkGroup** (*string*) -- The name of the workgroup. Required if making an IAM Identity Center request. Return type: dict Returns: **Response Syntax** { 'DataCatalog': { 'Name': 'string', 'Description': 'string', 'Type': 'LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', 'Parameters': { 'string': 'string' }, 'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED', 'ConnectionType': 'DYNAMODB'|'MYSQL'|'POSTGRESQL'|'REDSHIFT'|'ORACLE'|'SYNAPSE'|'SQLSERVER'|'DB2'|'OPENSEARCH'|'BIGQUERY'|'GOOGLECLOUDSTORAGE'|'HBASE'|'DOCUMENTDB'|'CMDB'|'TPCDS'|'TIMESTREAM'|'SAPHANA'|'SNOWFLAKE'|'DATALAKEGEN2'|'DB2AS400', 'Error': 'string' } } **Response Structure** * *(dict) --* * **DataCatalog** *(dict) --* The data catalog returned. * **Name** *(string) --* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Description** *(string) --* An optional description of the data catalog. * **Type** *(string) --* The type of data catalog to create: "LAMBDA" for a federated catalog, "GLUE" for an Glue Data Catalog, and "HIVE" for an external Apache Hive metastore. "FEDERATED" is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass. * **Parameters** *(dict) --* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type. * For the "HIVE" data catalog type, use the following syntax. The "metadata-function" parameter is required. "The sdk-version" parameter is optional and defaults to the currently supported version. "metadata- function=lambda_arn, sdk-version=version_number" * For the "LAMBDA" data catalog type, use one of the following sets of required parameters, but not both. * If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required. "metadata-function=lambda_arn, record- function=lambda_arn" * If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function. "function=lambda_arn" * The "GLUE" type takes a catalog ID parameter and is required. The "catalog_id" is the account ID of the Amazon Web Services account to which the Glue catalog belongs. "catalog-id=catalog_id" * The "GLUE" data catalog type also applies to the default "AwsDataCatalog" that already exists in your account, of which you can have only one and cannot modify. * The "FEDERATED" data catalog type uses one of the following parameters, but not both. Use "connection-arn" for an existing Glue connection. Use "connection-type" and "connection-properties" to specify the configuration setting for a new connection. * "connection-arn:" * "connection-type:MYSQL|REDSHIFT|...., connection- properties:""" For "" , use escaped JSON text, as in the following example. ""{\"spill_bucket\":\"my_spill\",\"spill_prefix \":\"athena-spill\",\"host\":\"abc12345.snowflakecomp uting.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\ ",\"database\":\"TEST\",\"schema\":\"PUBLIC\",\"Secre tArn\":\"arn:aws:secretsmanager:ap- south-1:111122223333:secret:snowflake-XHb67j\"}"" * *(string) --* * *(string) --* * **Status** *(string) --* The status of the creation or deletion of the data catalog. * The "LAMBDA", "GLUE", and "HIVE" data catalog types are created synchronously. Their status is either "CREATE_COMPLETE" or "CREATE_FAILED". * The "FEDERATED" data catalog type is created asynchronously. Data catalog creation status: * "CREATE_IN_PROGRESS": Federated data catalog creation in progress. * "CREATE_COMPLETE": Data catalog creation complete. * "CREATE_FAILED": Data catalog could not be created. * "CREATE_FAILED_CLEANUP_IN_PROGRESS": Federated data catalog creation failed and is being removed. * "CREATE_FAILED_CLEANUP_COMPLETE": Federated data catalog creation failed and was removed. * "CREATE_FAILED_CLEANUP_FAILED": Federated data catalog creation failed but could not be removed. Data catalog deletion status: * "DELETE_IN_PROGRESS": Federated data catalog deletion in progress. * "DELETE_COMPLETE": Federated data catalog deleted. * "DELETE_FAILED": Federated data catalog could not be deleted. * **ConnectionType** *(string) --* The type of connection for a "FEDERATED" data catalog (for example, "REDSHIFT", "MYSQL", or "SQLSERVER"). For information about individual connectors, see Available data source connectors. * **Error** *(string) --* Text of the error that occurred during data catalog creation or deletion. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_sessions list_sessions ************* Athena.Client.list_sessions(**kwargs) Lists the sessions in a workgroup that are in an active state like "CREATING", "CREATED", "IDLE", or "BUSY". Newer sessions are listed first; older sessions are listed later. See also: AWS API Documentation **Request Syntax** response = client.list_sessions( WorkGroup='string', StateFilter='CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED', MaxResults=123, NextToken='string' ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup to which the session belongs. * **StateFilter** (*string*) -- A filter for a specific session state. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. * **MaxResults** (*integer*) -- The maximum number of sessions to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'Sessions': [ { 'SessionId': 'string', 'Description': 'string', 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'NotebookVersion': 'string', 'Status': { 'StartDateTime': datetime(2015, 1, 1), 'LastModifiedDateTime': datetime(2015, 1, 1), 'EndDateTime': datetime(2015, 1, 1), 'IdleSinceDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED', 'StateChangeReason': 'string' } }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **Sessions** *(list) --* A list of sessions. * *(dict) --* Contains summary information about a session. * **SessionId** *(string) --* The session ID. * **Description** *(string) --* The session description. * **EngineVersion** *(dict) --* The engine version used by the session (for example, "PySpark engine version 3"). * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **NotebookVersion** *(string) --* The notebook version. * **Status** *(dict) --* Contains information about the session status. * **StartDateTime** *(datetime) --* The date and time that the session started. * **LastModifiedDateTime** *(datetime) --* The most recent date and time that the session was modified. * **EndDateTime** *(datetime) --* The date and time that the session ended. * **IdleSinceDateTime** *(datetime) --* The date and time starting at which the session became idle. Can be empty if the session is not currently idle. * **State** *(string) --* The state of the session. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. * **StateChangeReason** *(string) --* The reason for the session state change (for example, canceled because the session was terminated). **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_named_query get_named_query *************** Athena.Client.get_named_query(**kwargs) Returns information about a single query. Requires that you have access to the workgroup in which the query was saved. See also: AWS API Documentation **Request Syntax** response = client.get_named_query( NamedQueryId='string' ) Parameters: **NamedQueryId** (*string*) -- **[REQUIRED]** The unique ID of the query. Use ListNamedQueries to get query IDs. Return type: dict Returns: **Response Syntax** { 'NamedQuery': { 'Name': 'string', 'Description': 'string', 'Database': 'string', 'QueryString': 'string', 'NamedQueryId': 'string', 'WorkGroup': 'string' } } **Response Structure** * *(dict) --* * **NamedQuery** *(dict) --* Information about the query. * **Name** *(string) --* The query name. * **Description** *(string) --* The query description. * **Database** *(string) --* The database to which the query belongs. * **QueryString** *(string) --* The SQL statements that make up the query. * **NamedQueryId** *(string) --* The unique identifier of the query. * **WorkGroup** *(string) --* The name of the workgroup that contains the named query. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_calculation_execution_code get_calculation_execution_code ****************************** Athena.Client.get_calculation_execution_code(**kwargs) Retrieves the unencrypted code that was executed for the calculation. See also: AWS API Documentation **Request Syntax** response = client.get_calculation_execution_code( CalculationExecutionId='string' ) Parameters: **CalculationExecutionId** (*string*) -- **[REQUIRED]** The calculation execution UUID. Return type: dict Returns: **Response Syntax** { 'CodeBlock': 'string' } **Response Structure** * *(dict) --* * **CodeBlock** *(string) --* The unencrypted code that was executed for the calculation. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_capacity_reservation get_capacity_reservation ************************ Athena.Client.get_capacity_reservation(**kwargs) Returns information about the capacity reservation with the specified name. See also: AWS API Documentation **Request Syntax** response = client.get_capacity_reservation( Name='string' ) Parameters: **Name** (*string*) -- **[REQUIRED]** The name of the capacity reservation. Return type: dict Returns: **Response Syntax** { 'CapacityReservation': { 'Name': 'string', 'Status': 'PENDING'|'ACTIVE'|'CANCELLING'|'CANCELLED'|'FAILED'|'UPDATE_PENDING', 'TargetDpus': 123, 'AllocatedDpus': 123, 'LastAllocation': { 'Status': 'PENDING'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'RequestTime': datetime(2015, 1, 1), 'RequestCompletionTime': datetime(2015, 1, 1) }, 'LastSuccessfulAllocationTime': datetime(2015, 1, 1), 'CreationTime': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **CapacityReservation** *(dict) --* The requested capacity reservation structure. * **Name** *(string) --* The name of the capacity reservation. * **Status** *(string) --* The status of the capacity reservation. * **TargetDpus** *(integer) --* The number of data processing units requested. * **AllocatedDpus** *(integer) --* The number of data processing units currently allocated. * **LastAllocation** *(dict) --* Contains the submission time of a single allocation request for a capacity reservation and the most recent status of the attempted allocation. * **Status** *(string) --* The status of the capacity allocation. * **StatusMessage** *(string) --* The status message of the capacity allocation. * **RequestTime** *(datetime) --* The time when the capacity allocation was requested. * **RequestCompletionTime** *(datetime) --* The time when the capacity allocation request was completed. * **LastSuccessfulAllocationTime** *(datetime) --* The time of the most recent capacity allocation that succeeded. * **CreationTime** *(datetime) --* The time in UTC epoch millis when the capacity reservation was created. **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / list_tags_for_resource list_tags_for_resource ********************** Athena.Client.list_tags_for_resource(**kwargs) Lists the tags associated with an Athena resource. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( ResourceARN='string', NextToken='string', MaxResults=123 ) Parameters: * **ResourceARN** (*string*) -- **[REQUIRED]** Lists the tags for the resource with the specified ARN. * **NextToken** (*string*) -- The token for the next set of results, or null if there are no additional results for this request, where the request lists the tags for the resource with the specified ARN. * **MaxResults** (*integer*) -- The maximum number of results to be returned per request that lists the tags for the resource. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Tags** *(list) --* The list of tags associated with the specified resource. * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case- sensitive. * **NextToken** *(string) --* A token to be used by the next request if this request is truncated. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / create_prepared_statement create_prepared_statement ************************* Athena.Client.create_prepared_statement(**kwargs) Creates a prepared statement for use with SQL queries in Athena. See also: AWS API Documentation **Request Syntax** response = client.create_prepared_statement( StatementName='string', WorkGroup='string', QueryStatement='string', Description='string' ) Parameters: * **StatementName** (*string*) -- **[REQUIRED]** The name of the prepared statement. * **WorkGroup** (*string*) -- **[REQUIRED]** The name of the workgroup to which the prepared statement belongs. * **QueryStatement** (*string*) -- **[REQUIRED]** The query string for the prepared statement. * **Description** (*string*) -- The description of the prepared statement. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_calculation_execution get_calculation_execution ************************* Athena.Client.get_calculation_execution(**kwargs) Describes a previously submitted calculation execution. See also: AWS API Documentation **Request Syntax** response = client.get_calculation_execution( CalculationExecutionId='string' ) Parameters: **CalculationExecutionId** (*string*) -- **[REQUIRED]** The calculation execution UUID. Return type: dict Returns: **Response Syntax** { 'CalculationExecutionId': 'string', 'SessionId': 'string', 'Description': 'string', 'WorkingDirectory': 'string', 'Status': { 'SubmissionDateTime': datetime(2015, 1, 1), 'CompletionDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED', 'StateChangeReason': 'string' }, 'Statistics': { 'DpuExecutionInMillis': 123, 'Progress': 'string' }, 'Result': { 'StdOutS3Uri': 'string', 'StdErrorS3Uri': 'string', 'ResultS3Uri': 'string', 'ResultType': 'string' } } **Response Structure** * *(dict) --* * **CalculationExecutionId** *(string) --* The calculation execution UUID. * **SessionId** *(string) --* The session ID that the calculation ran in. * **Description** *(string) --* The description of the calculation execution. * **WorkingDirectory** *(string) --* The Amazon S3 location in which calculation results are stored. * **Status** *(dict) --* Contains information about the status of the calculation. * **SubmissionDateTime** *(datetime) --* The date and time the calculation was submitted for processing. * **CompletionDateTime** *(datetime) --* The date and time the calculation completed processing. * **State** *(string) --* The state of the calculation execution. A description of each state follows. "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. * **StateChangeReason** *(string) --* The reason for the calculation state change (for example, the calculation was canceled because the session was terminated). * **Statistics** *(dict) --* Contains information about the data processing unit (DPU) execution time and progress. This field is populated only when statistics are available. * **DpuExecutionInMillis** *(integer) --* The data processing unit execution time in milliseconds for the calculation. * **Progress** *(string) --* The progress of the calculation. * **Result** *(dict) --* Contains result information. This field is populated only if the calculation is completed. * **StdOutS3Uri** *(string) --* The Amazon S3 location of the "stdout" file for the calculation. * **StdErrorS3Uri** *(string) --* The Amazon S3 location of the "stderr" error messages file for the calculation. * **ResultS3Uri** *(string) --* The Amazon S3 location of the folder for the calculation results. * **ResultType** *(string) --* The data format of the calculation result. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / start_session start_session ************* Athena.Client.start_session(**kwargs) Creates a session for running calculations within a workgroup. The session is ready when it reaches an "IDLE" state. See also: AWS API Documentation **Request Syntax** response = client.start_session( Description='string', WorkGroup='string', EngineConfiguration={ 'CoordinatorDpuSize': 123, 'MaxConcurrentDpus': 123, 'DefaultExecutorDpuSize': 123, 'AdditionalConfigs': { 'string': 'string' }, 'SparkProperties': { 'string': 'string' } }, NotebookVersion='string', SessionIdleTimeoutInMinutes=123, ClientRequestToken='string' ) Parameters: * **Description** (*string*) -- The session description. * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup to which the session belongs. * **EngineConfiguration** (*dict*) -- **[REQUIRED]** Contains engine data processing unit (DPU) configuration settings and parameter mappings. * **CoordinatorDpuSize** *(integer) --* The number of DPUs to use for the coordinator. A coordinator is a special executor that orchestrates processing work and manages other executors in a notebook session. The default is 1. * **MaxConcurrentDpus** *(integer) --* **[REQUIRED]** The maximum number of DPUs that can run concurrently. * **DefaultExecutorDpuSize** *(integer) --* The default number of DPUs to use for executors. An executor is the smallest unit of compute that a notebook session can request from Athena. The default is 1. * **AdditionalConfigs** *(dict) --* Contains additional notebook engine "MAP" parameter mappings in the form of key-value pairs. To specify an Athena notebook that the Jupyter server will download and serve, specify a value for the StartSessionRequest$NotebookVersion field, and then add a key named "NotebookId" to "AdditionalConfigs" that has the value of the Athena notebook ID. * *(string) --* * *(string) --* * **SparkProperties** *(dict) --* Specifies custom jar files and Spark properties for use cases like cluster encryption, table formats, and general Spark tuning. * *(string) --* * *(string) --* * **NotebookVersion** (*string*) -- The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is "Athena notebook version 1". If you specify a value for "NotebookVersion", you must also specify a value for "NotebookId". See EngineConfiguration$AdditionalConfigs. * **SessionIdleTimeoutInMinutes** (*integer*) -- The idle timeout in minutes for the session. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another "StartSessionRequest" is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned. Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. Return type: dict Returns: **Response Syntax** { 'SessionId': 'string', 'State': 'CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED' } **Response Structure** * *(dict) --* * **SessionId** *(string) --* The session ID. * **State** *(string) --* The state of the session. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" * "Athena.Client.exceptions.SessionAlreadyExistsException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / batch_get_named_query batch_get_named_query ********************* Athena.Client.batch_get_named_query(**kwargs) 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. Requires you to have access to the workgroup in which the queries were saved. Use ListNamedQueriesInput to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under UnprocessedNamedQueryId. Named queries differ from executed queries. Use BatchGetQueryExecutionInput to get details about each unique query execution, and ListQueryExecutionsInput to get a list of query execution IDs. See also: AWS API Documentation **Request Syntax** response = client.batch_get_named_query( NamedQueryIds=[ 'string', ] ) Parameters: **NamedQueryIds** (*list*) -- **[REQUIRED]** An array of query IDs. * *(string) --* Return type: dict Returns: **Response Syntax** { 'NamedQueries': [ { 'Name': 'string', 'Description': 'string', 'Database': 'string', 'QueryString': 'string', 'NamedQueryId': 'string', 'WorkGroup': 'string' }, ], 'UnprocessedNamedQueryIds': [ { 'NamedQueryId': 'string', 'ErrorCode': 'string', 'ErrorMessage': 'string' }, ] } **Response Structure** * *(dict) --* * **NamedQueries** *(list) --* Information about the named query IDs submitted. * *(dict) --* A query, where "QueryString" contains the SQL statements that make up the query. * **Name** *(string) --* The query name. * **Description** *(string) --* The query description. * **Database** *(string) --* The database to which the query belongs. * **QueryString** *(string) --* The SQL statements that make up the query. * **NamedQueryId** *(string) --* The unique identifier of the query. * **WorkGroup** *(string) --* The name of the workgroup that contains the named query. * **UnprocessedNamedQueryIds** *(list) --* Information about provided query IDs. * *(dict) --* Information about a named query ID that could not be processed. * **NamedQueryId** *(string) --* The unique identifier of the named query. * **ErrorCode** *(string) --* The error code returned when the processing request for the named query failed, if applicable. * **ErrorMessage** *(string) --* The error message returned when the processing request for the named query failed, if applicable. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / delete_notebook delete_notebook *************** Athena.Client.delete_notebook(**kwargs) Deletes the specified notebook. See also: AWS API Documentation **Request Syntax** response = client.delete_notebook( NotebookId='string' ) Parameters: **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / untag_resource untag_resource ************** Athena.Client.untag_resource(**kwargs) Removes one or more tags from an Athena resource. See also: AWS API Documentation **Request Syntax** response = client.untag_resource( ResourceARN='string', TagKeys=[ 'string', ] ) Parameters: * **ResourceARN** (*string*) -- **[REQUIRED]** Specifies the ARN of the resource from which tags are to be removed. * **TagKeys** (*list*) -- **[REQUIRED]** A comma-separated list of one or more tag keys whose tags are to be removed from the specified resource. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / create_named_query create_named_query ****************** Athena.Client.create_named_query(**kwargs) Creates a named query in the specified workgroup. Requires that you have access to the workgroup. See also: AWS API Documentation **Request Syntax** response = client.create_named_query( Name='string', Description='string', Database='string', QueryString='string', ClientRequestToken='string', WorkGroup='string' ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The query name. * **Description** (*string*) -- The query description. * **Database** (*string*) -- **[REQUIRED]** The database to which the query belongs. * **QueryString** (*string*) -- **[REQUIRED]** The contents of the query with all query statements. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another "CreateNamedQuery" request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the "QueryString", an error is returned. Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. This field is autopopulated if not provided. * **WorkGroup** (*string*) -- The name of the workgroup in which the named query is being created. Return type: dict Returns: **Response Syntax** { 'NamedQueryId': 'string' } **Response Structure** * *(dict) --* * **NamedQueryId** *(string) --* The unique ID of the query. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / start_calculation_execution start_calculation_execution *************************** Athena.Client.start_calculation_execution(**kwargs) Submits calculations for execution within a session. You can supply the code to run as an inline code block within the request. Note: The request syntax requires the StartCalculationExecutionRequest$CodeBlock parameter or the CalculationConfiguration$CodeBlock parameter, but not both. Because CalculationConfiguration$CodeBlock is deprecated, use the StartCalculationExecutionRequest$CodeBlock parameter instead. See also: AWS API Documentation **Request Syntax** response = client.start_calculation_execution( SessionId='string', Description='string', CalculationConfiguration={ 'CodeBlock': 'string' }, CodeBlock='string', ClientRequestToken='string' ) Parameters: * **SessionId** (*string*) -- **[REQUIRED]** The session ID. * **Description** (*string*) -- A description of the calculation. * **CalculationConfiguration** (*dict*) -- Contains configuration information for the calculation. * **CodeBlock** *(string) --* A string that contains the code for the calculation. * **CodeBlock** (*string*) -- A string that contains the code of the calculation. Use this parameter instead of CalculationConfiguration$CodeBlock, which is deprecated. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another "StartCalculationExecutionRequest" is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned. Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. Return type: dict Returns: **Response Syntax** { 'CalculationExecutionId': 'string', 'State': 'CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED' } **Response Structure** * *(dict) --* * **CalculationExecutionId** *(string) --* The calculation execution UUID. * **State** *(string) --* "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / delete_named_query delete_named_query ****************** Athena.Client.delete_named_query(**kwargs) Deletes the named query if you have access to the workgroup in which the query was saved. See also: AWS API Documentation **Request Syntax** response = client.delete_named_query( NamedQueryId='string' ) Parameters: **NamedQueryId** (*string*) -- **[REQUIRED]** The unique ID of the query to delete. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_table_metadata list_table_metadata ******************* Athena.Client.list_table_metadata(**kwargs) Lists the metadata for the tables in the specified data catalog database. See also: AWS API Documentation **Request Syntax** response = client.list_table_metadata( CatalogName='string', DatabaseName='string', Expression='string', NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog for which table metadata should be returned. * **DatabaseName** (*string*) -- **[REQUIRED]** The name of the database for which table metadata should be returned. * **Expression** (*string*) -- A regex filter that pattern- matches table names. If no expression is supplied, metadata for all tables are listed. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. * **MaxResults** (*integer*) -- Specifies the maximum number of results to return. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. Return type: dict Returns: **Response Syntax** { 'TableMetadataList': [ { 'Name': 'string', 'CreateTime': datetime(2015, 1, 1), 'LastAccessTime': datetime(2015, 1, 1), 'TableType': 'string', 'Columns': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'PartitionKeys': [ { 'Name': 'string', 'Type': 'string', 'Comment': 'string' }, ], 'Parameters': { 'string': 'string' } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **TableMetadataList** *(list) --* A list of table metadata. * *(dict) --* Contains metadata for a table. * **Name** *(string) --* The name of the table. * **CreateTime** *(datetime) --* The time that the table was created. * **LastAccessTime** *(datetime) --* The last time the table was accessed. * **TableType** *(string) --* The type of table. In Athena, only "EXTERNAL_TABLE" is supported. * **Columns** *(list) --* A list of the columns in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **PartitionKeys** *(list) --* A list of the partition keys in the table. * *(dict) --* Contains metadata for a column in a table. * **Name** *(string) --* The name of the column. * **Type** *(string) --* The data type of the column. * **Comment** *(string) --* Optional information about the column. * **Parameters** *(dict) --* A set of custom key/value pairs for table properties. * *(string) --* * *(string) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.MetadataException" Athena / Client / get_waiter get_waiter ********** Athena.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" Athena / Client / list_databases list_databases ************** Athena.Client.list_databases(**kwargs) Lists the databases in the specified data catalog. See also: AWS API Documentation **Request Syntax** response = client.list_databases( CatalogName='string', NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog that contains the databases to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- Specifies the maximum number of results to return. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. Return type: dict Returns: **Response Syntax** { 'DatabaseList': [ { 'Name': 'string', 'Description': 'string', 'Parameters': { 'string': 'string' } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **DatabaseList** *(list) --* A list of databases from a data catalog. * *(dict) --* Contains metadata information for a database in a data catalog. * **Name** *(string) --* The name of the database. * **Description** *(string) --* An optional description of the database. * **Parameters** *(dict) --* A set of custom key/value pairs. * *(string) --* * *(string) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.MetadataException" Athena / Client / start_query_execution start_query_execution ********************* Athena.Client.start_query_execution(**kwargs) Runs the SQL query statements contained in the "Query". Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires GetDataCatalog permission to the catalog. For code samples using the Amazon Web Services SDK for Java, see Examples and Code Samples in the *Amazon Athena User Guide*. See also: AWS API Documentation **Request Syntax** response = client.start_query_execution( QueryString='string', ClientRequestToken='string', QueryExecutionContext={ 'Database': 'string', 'Catalog': 'string' }, ResultConfiguration={ 'OutputLocation': 'string', 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'ExpectedBucketOwner': 'string', 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' } }, WorkGroup='string', ExecutionParameters=[ 'string', ], ResultReuseConfiguration={ 'ResultReuseByAgeConfiguration': { 'Enabled': True|False, 'MaxAgeInMinutes': 123 } } ) Parameters: * **QueryString** (*string*) -- **[REQUIRED]** The SQL query statements to be executed. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another "StartQueryExecution" request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as "QueryString", has changed. A call to "StartQueryExecution" that uses a previous client request token returns the same "QueryExecutionId" even if the requester doesn't have permission on the tables specified in "QueryString". Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. This field is autopopulated if not provided. * **QueryExecutionContext** (*dict*) -- The database within which the query executes. * **Database** *(string) --* The name of the database used in the query execution. The database must exist in the catalog. * **Catalog** *(string) --* The name of the data catalog used in the query execution. * **ResultConfiguration** (*dict*) -- Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **EncryptionOption** *(string) --* **[REQUIRED]** Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **S3AclOption** *(string) --* **[REQUIRED]** The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **WorkGroup** (*string*) -- The name of the workgroup in which the query is being started. * **ExecutionParameters** (*list*) -- A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur. * *(string) --* * **ResultReuseConfiguration** (*dict*) -- Specifies the query result reuse behavior for the query. * **ResultReuseByAgeConfiguration** *(dict) --* Specifies whether previous query results are reused, and if so, their maximum age. * **Enabled** *(boolean) --* **[REQUIRED]** True if previous query results can be reused when the query is run; otherwise, false. The default is false. * **MaxAgeInMinutes** *(integer) --* Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. The default is 60. Return type: dict Returns: **Response Syntax** { 'QueryExecutionId': 'string' } **Response Structure** * *(dict) --* * **QueryExecutionId** *(string) --* The unique ID of the query that ran as a result of this request. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / update_data_catalog update_data_catalog ******************* Athena.Client.update_data_catalog(**kwargs) Updates the data catalog that has the specified name. See also: AWS API Documentation **Request Syntax** response = client.update_data_catalog( Name='string', Type='LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', Description='string', Parameters={ 'string': 'string' } ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Type** (*string*) -- **[REQUIRED]** Specifies the type of data catalog to update. Specify "LAMBDA" for a federated catalog, "HIVE" for an external hive metastore, or "GLUE" for an Glue Data Catalog. * **Description** (*string*) -- New or modified text that describes the data catalog. * **Parameters** (*dict*) -- Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type. * For the "HIVE" data catalog type, use the following syntax. The "metadata-function" parameter is required. "The sdk- version" parameter is optional and defaults to the currently supported version. "metadata-function=lambda_arn, sdk- version=version_number" * For the "LAMBDA" data catalog type, use one of the following sets of required parameters, but not both. * If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required. "metadata- function=lambda_arn, record-function=lambda_arn" * If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function. "function=lambda_arn" * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_prepared_statement get_prepared_statement ********************** Athena.Client.get_prepared_statement(**kwargs) Retrieves the prepared statement with the specified name from the specified workgroup. See also: AWS API Documentation **Request Syntax** response = client.get_prepared_statement( StatementName='string', WorkGroup='string' ) Parameters: * **StatementName** (*string*) -- **[REQUIRED]** The name of the prepared statement to retrieve. * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup to which the statement to be retrieved belongs. Return type: dict Returns: **Response Syntax** { 'PreparedStatement': { 'StatementName': 'string', 'QueryStatement': 'string', 'WorkGroupName': 'string', 'Description': 'string', 'LastModifiedTime': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **PreparedStatement** *(dict) --* The name of the prepared statement that was retrieved. * **StatementName** *(string) --* The name of the prepared statement. * **QueryStatement** *(string) --* The query string for the prepared statement. * **WorkGroupName** *(string) --* The name of the workgroup to which the prepared statement belongs. * **Description** *(string) --* The description of the prepared statement. * **LastModifiedTime** *(datetime) --* The last modified time of the prepared statement. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / get_capacity_assignment_configuration get_capacity_assignment_configuration ************************************* Athena.Client.get_capacity_assignment_configuration(**kwargs) Gets the capacity assignment configuration for a capacity reservation, if one exists. See also: AWS API Documentation **Request Syntax** response = client.get_capacity_assignment_configuration( CapacityReservationName='string' ) Parameters: **CapacityReservationName** (*string*) -- **[REQUIRED]** The name of the capacity reservation to retrieve the capacity assignment configuration for. Return type: dict Returns: **Response Syntax** { 'CapacityAssignmentConfiguration': { 'CapacityReservationName': 'string', 'CapacityAssignments': [ { 'WorkGroupNames': [ 'string', ] }, ] } } **Response Structure** * *(dict) --* * **CapacityAssignmentConfiguration** *(dict) --* The requested capacity assignment configuration for the specified capacity reservation. * **CapacityReservationName** *(string) --* The name of the reservation that the capacity assignment configuration is for. * **CapacityAssignments** *(list) --* The list of assignments that make up the capacity assignment configuration. * *(dict) --* A mapping between one or more workgroups and a capacity reservation. * **WorkGroupNames** *(list) --* The list of workgroup names for the capacity assignment. * *(string) --* **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / update_notebook_metadata update_notebook_metadata ************************ Athena.Client.update_notebook_metadata(**kwargs) Updates the metadata for a notebook. See also: AWS API Documentation **Request Syntax** response = client.update_notebook_metadata( NotebookId='string', ClientRequestToken='string', Name='string' ) Parameters: * **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook to update the metadata for. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once). Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. * **Name** (*string*) -- **[REQUIRED]** The name to update the notebook to. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / list_prepared_statements list_prepared_statements ************************ Athena.Client.list_prepared_statements(**kwargs) Lists the prepared statements in the specified workgroup. See also: AWS API Documentation **Request Syntax** response = client.list_prepared_statements( WorkGroup='string', NextToken='string', MaxResults=123 ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The workgroup to list the prepared statements for. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of results to return in this request. Return type: dict Returns: **Response Syntax** { 'PreparedStatements': [ { 'StatementName': 'string', 'LastModifiedTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **PreparedStatements** *(list) --* The list of prepared statements for the workgroup. * *(dict) --* The name and last modified time of the prepared statement. * **StatementName** *(string) --* The name of the prepared statement. * **LastModifiedTime** *(datetime) --* The last modified time of the prepared statement. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_named_queries list_named_queries ****************** Athena.Client.list_named_queries(**kwargs) Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup. See also: AWS API Documentation **Request Syntax** response = client.list_named_queries( NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of queries to return in this request. * **WorkGroup** (*string*) -- The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned. Return type: dict Returns: **Response Syntax** { 'NamedQueryIds': [ 'string', ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **NamedQueryIds** *(list) --* The list of unique query IDs. * *(string) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_notebook_metadata list_notebook_metadata ********************** Athena.Client.list_notebook_metadata(**kwargs) Displays the notebook files for the specified workgroup in paginated format. See also: AWS API Documentation **Request Syntax** response = client.list_notebook_metadata( Filters={ 'Name': 'string' }, NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **Filters** (*dict*) -- Search filter string. * **Name** *(string) --* The name of the notebook to search for. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. * **MaxResults** (*integer*) -- Specifies the maximum number of results to return. * **WorkGroup** (*string*) -- **[REQUIRED]** The name of the Spark enabled workgroup to retrieve notebook metadata for. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'NotebookMetadataList': [ { 'NotebookId': 'string', 'Name': 'string', 'WorkGroup': 'string', 'CreationTime': datetime(2015, 1, 1), 'Type': 'IPYNB', 'LastModifiedTime': datetime(2015, 1, 1) }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **NotebookMetadataList** *(list) --* The list of notebook metadata for the specified workgroup. * *(dict) --* Contains metadata for notebook, including the notebook name, ID, workgroup, and time created. * **NotebookId** *(string) --* The notebook ID. * **Name** *(string) --* The name of the notebook. * **WorkGroup** *(string) --* The name of the Spark enabled workgroup to which the notebook belongs. * **CreationTime** *(datetime) --* The time when the notebook was created. * **Type** *(string) --* The type of notebook. Currently, the only valid type is "IPYNB". * **LastModifiedTime** *(datetime) --* The time when the notebook was last modified. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / get_session get_session *********** Athena.Client.get_session(**kwargs) Gets the full details of a previously created session, including the session status and configuration. See also: AWS API Documentation **Request Syntax** response = client.get_session( SessionId='string' ) Parameters: **SessionId** (*string*) -- **[REQUIRED]** The session ID. Return type: dict Returns: **Response Syntax** { 'SessionId': 'string', 'Description': 'string', 'WorkGroup': 'string', 'EngineVersion': 'string', 'EngineConfiguration': { 'CoordinatorDpuSize': 123, 'MaxConcurrentDpus': 123, 'DefaultExecutorDpuSize': 123, 'AdditionalConfigs': { 'string': 'string' }, 'SparkProperties': { 'string': 'string' } }, 'NotebookVersion': 'string', 'SessionConfiguration': { 'ExecutionRole': 'string', 'WorkingDirectory': 'string', 'IdleTimeoutSeconds': 123, 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' } }, 'Status': { 'StartDateTime': datetime(2015, 1, 1), 'LastModifiedDateTime': datetime(2015, 1, 1), 'EndDateTime': datetime(2015, 1, 1), 'IdleSinceDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED', 'StateChangeReason': 'string' }, 'Statistics': { 'DpuExecutionInMillis': 123 } } **Response Structure** * *(dict) --* * **SessionId** *(string) --* The session ID. * **Description** *(string) --* The session description. * **WorkGroup** *(string) --* The workgroup to which the session belongs. * **EngineVersion** *(string) --* The engine version used by the session (for example, "PySpark engine version 3"). You can get a list of engine versions by calling ListEngineVersions. * **EngineConfiguration** *(dict) --* Contains engine configuration information like DPU usage. * **CoordinatorDpuSize** *(integer) --* The number of DPUs to use for the coordinator. A coordinator is a special executor that orchestrates processing work and manages other executors in a notebook session. The default is 1. * **MaxConcurrentDpus** *(integer) --* The maximum number of DPUs that can run concurrently. * **DefaultExecutorDpuSize** *(integer) --* The default number of DPUs to use for executors. An executor is the smallest unit of compute that a notebook session can request from Athena. The default is 1. * **AdditionalConfigs** *(dict) --* Contains additional notebook engine "MAP" parameter mappings in the form of key-value pairs. To specify an Athena notebook that the Jupyter server will download and serve, specify a value for the StartSessionRequest$NotebookVersion field, and then add a key named "NotebookId" to "AdditionalConfigs" that has the value of the Athena notebook ID. * *(string) --* * *(string) --* * **SparkProperties** *(dict) --* Specifies custom jar files and Spark properties for use cases like cluster encryption, table formats, and general Spark tuning. * *(string) --* * *(string) --* * **NotebookVersion** *(string) --* The notebook version. * **SessionConfiguration** *(dict) --* Contains the workgroup configuration information used by the session. * **ExecutionRole** *(string) --* The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups. * **WorkingDirectory** *(string) --* The Amazon S3 location that stores information for the notebook. * **IdleTimeoutSeconds** *(integer) --* The idle timeout in seconds for the session. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. * **EncryptionOption** *(string) --* Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **Status** *(dict) --* Contains information about the status of the session. * **StartDateTime** *(datetime) --* The date and time that the session started. * **LastModifiedDateTime** *(datetime) --* The most recent date and time that the session was modified. * **EndDateTime** *(datetime) --* The date and time that the session ended. * **IdleSinceDateTime** *(datetime) --* The date and time starting at which the session became idle. Can be empty if the session is not currently idle. * **State** *(string) --* The state of the session. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. * **StateChangeReason** *(string) --* The reason for the session state change (for example, canceled because the session was terminated). * **Statistics** *(dict) --* Contains the DPU execution time. * **DpuExecutionInMillis** *(integer) --* The data processing unit execution time for a session in milliseconds. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / cancel_capacity_reservation cancel_capacity_reservation *************************** Athena.Client.cancel_capacity_reservation(**kwargs) Cancels the capacity reservation with the specified name. Cancelled reservations remain in your account and will be deleted 45 days after cancellation. During the 45 days, you cannot re-purpose or reuse a reservation that has been cancelled, but you can refer to its tags and view it for historical reference. See also: AWS API Documentation **Request Syntax** response = client.cancel_capacity_reservation( Name='string' ) Parameters: **Name** (*string*) -- **[REQUIRED]** The name of the capacity reservation to cancel. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / list_application_dpu_sizes list_application_dpu_sizes ************************** Athena.Client.list_application_dpu_sizes(**kwargs) Returns the supported DPU sizes for the supported application runtimes (for example, "Athena notebook version 1"). See also: AWS API Documentation **Request Syntax** response = client.list_application_dpu_sizes( MaxResults=123, NextToken='string' ) Parameters: * **MaxResults** (*integer*) -- Specifies the maximum number of results to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. Return type: dict Returns: **Response Syntax** { 'ApplicationDPUSizes': [ { 'ApplicationRuntimeId': 'string', 'SupportedDPUSizes': [ 123, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **ApplicationDPUSizes** *(list) --* A list of the supported DPU sizes that the application runtime supports. * *(dict) --* Contains the application runtime IDs and their supported DPU sizes. * **ApplicationRuntimeId** *(string) --* The name of the supported application runtime (for example, "Athena notebook version 1"). * **SupportedDPUSizes** *(list) --* A list of the supported DPU sizes that the application runtime supports. * *(integer) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / create_presigned_notebook_url create_presigned_notebook_url ***************************** Athena.Client.create_presigned_notebook_url(**kwargs) Gets an authentication token and the URL at which the notebook can be accessed. During programmatic access, "CreatePresignedNotebookUrl" must be called every 10 minutes to refresh the authentication token. For information about granting programmatic access, see Grant programmatic access. See also: AWS API Documentation **Request Syntax** response = client.create_presigned_notebook_url( SessionId='string' ) Parameters: **SessionId** (*string*) -- **[REQUIRED]** The session ID. Return type: dict Returns: **Response Syntax** { 'NotebookUrl': 'string', 'AuthToken': 'string', 'AuthTokenExpirationTime': 123 } **Response Structure** * *(dict) --* * **NotebookUrl** *(string) --* The URL of the notebook. The URL includes the authentication token and notebook file name and points directly to the opened notebook. * **AuthToken** *(string) --* The authentication token for the notebook. * **AuthTokenExpirationTime** *(integer) --* The UTC epoch time when the authentication token expires. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / export_notebook export_notebook *************** Athena.Client.export_notebook(**kwargs) Exports the specified notebook and its metadata. See also: AWS API Documentation **Request Syntax** response = client.export_notebook( NotebookId='string' ) Parameters: **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook to export. Return type: dict Returns: **Response Syntax** { 'NotebookMetadata': { 'NotebookId': 'string', 'Name': 'string', 'WorkGroup': 'string', 'CreationTime': datetime(2015, 1, 1), 'Type': 'IPYNB', 'LastModifiedTime': datetime(2015, 1, 1) }, 'Payload': 'string' } **Response Structure** * *(dict) --* * **NotebookMetadata** *(dict) --* The notebook metadata, including notebook ID, notebook name, and workgroup name. * **NotebookId** *(string) --* The notebook ID. * **Name** *(string) --* The name of the notebook. * **WorkGroup** *(string) --* The name of the Spark enabled workgroup to which the notebook belongs. * **CreationTime** *(datetime) --* The time when the notebook was created. * **Type** *(string) --* The type of notebook. Currently, the only valid type is "IPYNB". * **LastModifiedTime** *(datetime) --* The time when the notebook was last modified. * **Payload** *(string) --* The content of the exported notebook. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / close close ***** Athena.Client.close() Closes underlying endpoint connections. Athena / Client / get_work_group get_work_group ************** Athena.Client.get_work_group(**kwargs) Returns information about the workgroup with the specified name. See also: AWS API Documentation **Request Syntax** response = client.get_work_group( WorkGroup='string' ) Parameters: **WorkGroup** (*string*) -- **[REQUIRED]** The name of the workgroup. Return type: dict Returns: **Response Syntax** { 'WorkGroup': { 'Name': 'string', 'State': 'ENABLED'|'DISABLED', 'Configuration': { 'ResultConfiguration': { 'OutputLocation': 'string', 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'ExpectedBucketOwner': 'string', 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' } }, 'ManagedQueryResultsConfiguration': { 'Enabled': True|False, 'EncryptionConfiguration': { 'KmsKey': 'string' } }, 'EnforceWorkGroupConfiguration': True|False, 'PublishCloudWatchMetricsEnabled': True|False, 'BytesScannedCutoffPerQuery': 123, 'RequesterPaysEnabled': True|False, 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'AdditionalConfiguration': 'string', 'ExecutionRole': 'string', 'CustomerContentEncryptionConfiguration': { 'KmsKey': 'string' }, 'EnableMinimumEncryptionConfiguration': True|False, 'IdentityCenterConfiguration': { 'EnableIdentityCenter': True|False, 'IdentityCenterInstanceArn': 'string' }, 'QueryResultsS3AccessGrantsConfiguration': { 'EnableS3AccessGrants': True|False, 'CreateUserLevelPrefix': True|False, 'AuthenticationType': 'DIRECTORY_IDENTITY' } }, 'Description': 'string', 'CreationTime': datetime(2015, 1, 1), 'IdentityCenterApplicationArn': 'string' } } **Response Structure** * *(dict) --* * **WorkGroup** *(dict) --* Information about the workgroup. * **Name** *(string) --* The workgroup name. * **State** *(string) --* The state of the workgroup: ENABLED or DISABLED. * **Configuration** *(dict) --* The configuration of the workgroup, which includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for query and calculation results; whether the Amazon CloudWatch Metrics are enabled for the workgroup; whether workgroup settings override client-side settings; and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in "EnforceWorkGroupConfiguration" (true/false) in the "WorkGroupConfiguration". See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **ResultConfiguration** *(dict) --* The configuration for the workgroup, which includes the location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query and calculation results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using ResultConfiguration$OutputLocation. If none of them is set, Athena issues an error that no output location is provided. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **EncryptionOption** *(string) --* Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **S3AclOption** *(string) --* The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **ManagedQueryResultsConfiguration** *(dict) --* The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. * **Enabled** *(boolean) --* If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under "ResultConfiguration$OutputLocation". The default is false. A workgroup cannot have the "ResultConfiguration$OutputLocation" parameter when you set this field to true. * **EncryptionConfiguration** *(dict) --* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information. * **KmsKey** *(string) --* The ARN of an KMS key for encrypting managed query results. * **EnforceWorkGroupConfiguration** *(boolean) --* If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings. * **PublishCloudWatchMetricsEnabled** *(boolean) --* Indicates that the Amazon CloudWatch metrics are enabled for the workgroup. * **BytesScannedCutoffPerQuery** *(integer) --* The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. * **RequesterPaysEnabled** *(boolean) --* If set to "true", allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to "false", workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is "false". For more information about Requester Pays buckets, see Requester Pays Buckets in the *Amazon Simple Storage Service Developer Guide*. * **EngineVersion** *(dict) --* The engine version that all queries running on the workgroup use. Queries on the "AmazonAthenaPreviewFunctionality" workgroup run on the preview engine regardless of this setting. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **AdditionalConfiguration** *(string) --* Specifies a user defined JSON string that is passed to the notebook engine. * **ExecutionRole** *(string) --* The ARN of the execution role used to access user resources for Spark sessions and IAM Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and IAM Identity Center enabled workgroups. The property is required for IAM Identity Center enabled workgroups. * **CustomerContentEncryptionConfiguration** *(dict) --* Specifies the KMS key that is used to encrypt the user's data stores in Athena. This setting does not apply to Athena SQL workgroups. * **KmsKey** *(string) --* The customer managed KMS key that is used to encrypt the user's data stores in Athena. * **EnableMinimumEncryptionConfiguration** *(boolean) --* Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries. The "EnforceWorkGroupConfiguration" setting takes precedence over the "EnableMinimumEncryptionConfiguration" flag. This means that if "EnforceWorkGroupConfiguration" is true, the "EnableMinimumEncryptionConfiguration" flag is ignored, and the workgroup configuration for encryption is used. * **IdentityCenterConfiguration** *(dict) --* Specifies whether the workgroup is IAM Identity Center supported. * **EnableIdentityCenter** *(boolean) --* Specifies whether the workgroup is IAM Identity Center supported. * **IdentityCenterInstanceArn** *(string) --* The IAM Identity Center instance ARN that the workgroup associates to. * **QueryResultsS3AccessGrantsConfiguration** *(dict) --* Specifies whether Amazon S3 access grants are enabled for query results. * **EnableS3AccessGrants** *(boolean) --* Specifies whether Amazon S3 access grants are enabled for query results. * **CreateUserLevelPrefix** *(boolean) --* When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location. * **AuthenticationType** *(string) --* The authentication type used for Amazon S3 access grants. Currently, only "DIRECTORY_IDENTITY" is supported. * **Description** *(string) --* The workgroup description. * **CreationTime** *(datetime) --* The date and time the workgroup was created. * **IdentityCenterApplicationArn** *(string) --* The ARN of the IAM Identity Center enabled application associated with the workgroup. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_data_catalogs list_data_catalogs ****************** Athena.Client.list_data_catalogs(**kwargs) Lists the data catalogs in the current Amazon Web Services account. Note: In the Athena console, data catalogs are listed as "data sources" on the **Data sources** page under the **Data source name** column. See also: AWS API Documentation **Request Syntax** response = client.list_data_catalogs( NextToken='string', MaxResults=123, WorkGroup='string' ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. * **MaxResults** (*integer*) -- Specifies the maximum number of data catalogs to return. * **WorkGroup** (*string*) -- The name of the workgroup. Required if making an IAM Identity Center request. Return type: dict Returns: **Response Syntax** { 'DataCatalogsSummary': [ { 'CatalogName': 'string', 'Type': 'LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', 'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED', 'ConnectionType': 'DYNAMODB'|'MYSQL'|'POSTGRESQL'|'REDSHIFT'|'ORACLE'|'SYNAPSE'|'SQLSERVER'|'DB2'|'OPENSEARCH'|'BIGQUERY'|'GOOGLECLOUDSTORAGE'|'HBASE'|'DOCUMENTDB'|'CMDB'|'TPCDS'|'TIMESTREAM'|'SAPHANA'|'SNOWFLAKE'|'DATALAKEGEN2'|'DB2AS400', 'Error': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **DataCatalogsSummary** *(list) --* A summary list of data catalogs. * *(dict) --* The summary information for the data catalog, which includes its name and type. * **CatalogName** *(string) --* The name of the data catalog. The catalog name is unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Type** *(string) --* The data catalog type. * **Status** *(string) --* The status of the creation or deletion of the data catalog. * The "LAMBDA", "GLUE", and "HIVE" data catalog types are created synchronously. Their status is either "CREATE_COMPLETE" or "CREATE_FAILED". * The "FEDERATED" data catalog type is created asynchronously. Data catalog creation status: * "CREATE_IN_PROGRESS": Federated data catalog creation in progress. * "CREATE_COMPLETE": Data catalog creation complete. * "CREATE_FAILED": Data catalog could not be created. * "CREATE_FAILED_CLEANUP_IN_PROGRESS": Federated data catalog creation failed and is being removed. * "CREATE_FAILED_CLEANUP_COMPLETE": Federated data catalog creation failed and was removed. * "CREATE_FAILED_CLEANUP_FAILED": Federated data catalog creation failed but could not be removed. Data catalog deletion status: * "DELETE_IN_PROGRESS": Federated data catalog deletion in progress. * "DELETE_COMPLETE": Federated data catalog deleted. * "DELETE_FAILED": Federated data catalog could not be deleted. * **ConnectionType** *(string) --* The type of connection for a "FEDERATED" data catalog (for example, "REDSHIFT", "MYSQL", or "SQLSERVER"). For information about individual connectors, see Available data source connectors. * **Error** *(string) --* Text of the error that occurred during data catalog creation or deletion. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / batch_get_prepared_statement batch_get_prepared_statement **************************** Athena.Client.batch_get_prepared_statement(**kwargs) 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. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in "UnprocessedPreparedStatementNames". See also: AWS API Documentation **Request Syntax** response = client.batch_get_prepared_statement( PreparedStatementNames=[ 'string', ], WorkGroup='string' ) Parameters: * **PreparedStatementNames** (*list*) -- **[REQUIRED]** A list of prepared statement names to return. * *(string) --* * **WorkGroup** (*string*) -- **[REQUIRED]** The name of the workgroup to which the prepared statements belong. Return type: dict Returns: **Response Syntax** { 'PreparedStatements': [ { 'StatementName': 'string', 'QueryStatement': 'string', 'WorkGroupName': 'string', 'Description': 'string', 'LastModifiedTime': datetime(2015, 1, 1) }, ], 'UnprocessedPreparedStatementNames': [ { 'StatementName': 'string', 'ErrorCode': 'string', 'ErrorMessage': 'string' }, ] } **Response Structure** * *(dict) --* * **PreparedStatements** *(list) --* The list of prepared statements returned. * *(dict) --* A prepared SQL statement for use with Athena. * **StatementName** *(string) --* The name of the prepared statement. * **QueryStatement** *(string) --* The query string for the prepared statement. * **WorkGroupName** *(string) --* The name of the workgroup to which the prepared statement belongs. * **Description** *(string) --* The description of the prepared statement. * **LastModifiedTime** *(datetime) --* The last modified time of the prepared statement. * **UnprocessedPreparedStatementNames** *(list) --* A list of one or more prepared statements that were requested but could not be returned. * *(dict) --* The name of a prepared statement that could not be returned. * **StatementName** *(string) --* The name of a prepared statement that could not be returned due to an error. * **ErrorCode** *(string) --* The error code returned when the request for the prepared statement failed. * **ErrorMessage** *(string) --* The error message containing the reason why the prepared statement could not be returned. The following error messages are possible: * "INVALID_INPUT" - The name of the prepared statement that was provided is not valid (for example, the name is too long). * "STATEMENT_NOT_FOUND" - A prepared statement with the name provided could not be found. * "UNAUTHORIZED" - The requester does not have permission to access the workgroup that contains the prepared statement. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_notebook_sessions list_notebook_sessions ********************** Athena.Client.list_notebook_sessions(**kwargs) Lists, in descending order, the sessions that have been created in a notebook that are in an active state like "CREATING", "CREATED", "IDLE" or "BUSY". Newer sessions are listed first; older sessions are listed later. See also: AWS API Documentation **Request Syntax** response = client.list_notebook_sessions( NotebookId='string', MaxResults=123, NextToken='string' ) Parameters: * **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook to list sessions for. * **MaxResults** (*integer*) -- The maximum number of notebook sessions to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. Return type: dict Returns: **Response Syntax** { 'NotebookSessionsList': [ { 'SessionId': 'string', 'CreationTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **NotebookSessionsList** *(list) --* A list of the sessions belonging to the notebook. * *(dict) --* Contains the notebook session ID and notebook session creation time. * **SessionId** *(string) --* The notebook session ID. * **CreationTime** *(datetime) --* The time when the notebook session was created. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / create_notebook create_notebook *************** Athena.Client.create_notebook(**kwargs) Creates an empty "ipynb" file in the specified Apache Spark enabled workgroup. Throws an error if a file in the workgroup with the same name already exists. See also: AWS API Documentation **Request Syntax** response = client.create_notebook( WorkGroup='string', Name='string', ClientRequestToken='string' ) Parameters: * **WorkGroup** (*string*) -- **[REQUIRED]** The name of the Spark enabled workgroup in which the notebook will be created. * **Name** (*string*) -- **[REQUIRED]** The name of the "ipynb" file to be created in the Spark workgroup, without the ".ipynb" extension. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once). Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. Return type: dict Returns: **Response Syntax** { 'NotebookId': 'string' } **Response Structure** * *(dict) --* * **NotebookId** *(string) --* A unique identifier for the notebook. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / stop_query_execution stop_query_execution ******************** Athena.Client.stop_query_execution(**kwargs) Stops a query execution. Requires you to have access to the workgroup in which the query ran. See also: AWS API Documentation **Request Syntax** response = client.stop_query_execution( QueryExecutionId='string' ) Parameters: **QueryExecutionId** (*string*) -- **[REQUIRED]** The unique ID of the query execution to stop. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / create_capacity_reservation create_capacity_reservation *************************** Athena.Client.create_capacity_reservation(**kwargs) Creates a capacity reservation with the specified name and number of requested data processing units. See also: AWS API Documentation **Request Syntax** response = client.create_capacity_reservation( TargetDpus=123, Name='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **TargetDpus** (*integer*) -- **[REQUIRED]** The number of requested data processing units. * **Name** (*string*) -- **[REQUIRED]** The name of the capacity reservation to create. * **Tags** (*list*) -- The tags for the capacity reservation. * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_database get_database ************ Athena.Client.get_database(**kwargs) Returns a database object for the specified database and data catalog. See also: AWS API Documentation **Request Syntax** response = client.get_database( CatalogName='string', DatabaseName='string', WorkGroup='string' ) Parameters: * **CatalogName** (*string*) -- **[REQUIRED]** The name of the data catalog that contains the database to return. * **DatabaseName** (*string*) -- **[REQUIRED]** The name of the database to return. * **WorkGroup** (*string*) -- The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog. Return type: dict Returns: **Response Syntax** { 'Database': { 'Name': 'string', 'Description': 'string', 'Parameters': { 'string': 'string' } } } **Response Structure** * *(dict) --* * **Database** *(dict) --* The database returned. * **Name** *(string) --* The name of the database. * **Description** *(string) --* An optional description of the database. * **Parameters** *(dict) --* A set of custom key/value pairs. * *(string) --* * *(string) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.MetadataException" Athena / Client / tag_resource tag_resource ************ Athena.Client.tag_resource(**kwargs) Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups, data catalogs, or capacity reservations by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( ResourceARN='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **ResourceARN** (*string*) -- **[REQUIRED]** Specifies the ARN of the Athena resource to which tags are to be added. * **Tags** (*list*) -- **[REQUIRED]** A collection of one or more tags, separated by commas, to be added to an Athena resource. * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / update_notebook update_notebook *************** Athena.Client.update_notebook(**kwargs) Updates the contents of a Spark notebook. See also: AWS API Documentation **Request Syntax** response = client.update_notebook( NotebookId='string', Payload='string', Type='IPYNB', SessionId='string', ClientRequestToken='string' ) Parameters: * **NotebookId** (*string*) -- **[REQUIRED]** The ID of the notebook to update. * **Payload** (*string*) -- **[REQUIRED]** The updated content for the notebook. * **Type** (*string*) -- **[REQUIRED]** The notebook content type. Currently, the only valid type is "IPYNB". * **SessionId** (*string*) -- The active notebook session ID. Required if the notebook has an active session. * **ClientRequestToken** (*string*) -- A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once). Warning: This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.TooManyRequestsException" Athena / Client / create_work_group create_work_group ***************** Athena.Client.create_work_group(**kwargs) Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup. See also: AWS API Documentation **Request Syntax** response = client.create_work_group( Name='string', Configuration={ 'ResultConfiguration': { 'OutputLocation': 'string', 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'ExpectedBucketOwner': 'string', 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' } }, 'ManagedQueryResultsConfiguration': { 'Enabled': True|False, 'EncryptionConfiguration': { 'KmsKey': 'string' } }, 'EnforceWorkGroupConfiguration': True|False, 'PublishCloudWatchMetricsEnabled': True|False, 'BytesScannedCutoffPerQuery': 123, 'RequesterPaysEnabled': True|False, 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'AdditionalConfiguration': 'string', 'ExecutionRole': 'string', 'CustomerContentEncryptionConfiguration': { 'KmsKey': 'string' }, 'EnableMinimumEncryptionConfiguration': True|False, 'IdentityCenterConfiguration': { 'EnableIdentityCenter': True|False, 'IdentityCenterInstanceArn': 'string' }, 'QueryResultsS3AccessGrantsConfiguration': { 'EnableS3AccessGrants': True|False, 'CreateUserLevelPrefix': True|False, 'AuthenticationType': 'DIRECTORY_IDENTITY' } }, Description='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The workgroup name. * **Configuration** (*dict*) -- Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with "EnforceWorkGroupConfiguration") in the "WorkGroupConfiguration" override client-side settings. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **ResultConfiguration** *(dict) --* The configuration for the workgroup, which includes the location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query and calculation results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using ResultConfiguration$OutputLocation. If none of them is set, Athena issues an error that no output location is provided. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **EncryptionOption** *(string) --* **[REQUIRED]** Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **S3AclOption** *(string) --* **[REQUIRED]** The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **ManagedQueryResultsConfiguration** *(dict) --* The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. * **Enabled** *(boolean) --* **[REQUIRED]** If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under "ResultConfiguration$OutputLocation". The default is false. A workgroup cannot have the "ResultConfiguration$OutputLocation" parameter when you set this field to true. * **EncryptionConfiguration** *(dict) --* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information. * **KmsKey** *(string) --* **[REQUIRED]** The ARN of an KMS key for encrypting managed query results. * **EnforceWorkGroupConfiguration** *(boolean) --* If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings. * **PublishCloudWatchMetricsEnabled** *(boolean) --* Indicates that the Amazon CloudWatch metrics are enabled for the workgroup. * **BytesScannedCutoffPerQuery** *(integer) --* The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. * **RequesterPaysEnabled** *(boolean) --* If set to "true", allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to "false", workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is "false". For more information about Requester Pays buckets, see Requester Pays Buckets in the *Amazon Simple Storage Service Developer Guide*. * **EngineVersion** *(dict) --* The engine version that all queries running on the workgroup use. Queries on the "AmazonAthenaPreviewFunctionality" workgroup run on the preview engine regardless of this setting. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **AdditionalConfiguration** *(string) --* Specifies a user defined JSON string that is passed to the notebook engine. * **ExecutionRole** *(string) --* The ARN of the execution role used to access user resources for Spark sessions and IAM Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and IAM Identity Center enabled workgroups. The property is required for IAM Identity Center enabled workgroups. * **CustomerContentEncryptionConfiguration** *(dict) --* Specifies the KMS key that is used to encrypt the user's data stores in Athena. This setting does not apply to Athena SQL workgroups. * **KmsKey** *(string) --* **[REQUIRED]** The customer managed KMS key that is used to encrypt the user's data stores in Athena. * **EnableMinimumEncryptionConfiguration** *(boolean) --* Enforces a minimal level of encryption for the workgroup for query and calculation results that are written to Amazon S3. When enabled, workgroup users can set encryption only to the minimum level set by the administrator or higher when they submit queries. The "EnforceWorkGroupConfiguration" setting takes precedence over the "EnableMinimumEncryptionConfiguration" flag. This means that if "EnforceWorkGroupConfiguration" is true, the "EnableMinimumEncryptionConfiguration" flag is ignored, and the workgroup configuration for encryption is used. * **IdentityCenterConfiguration** *(dict) --* Specifies whether the workgroup is IAM Identity Center supported. * **EnableIdentityCenter** *(boolean) --* Specifies whether the workgroup is IAM Identity Center supported. * **IdentityCenterInstanceArn** *(string) --* The IAM Identity Center instance ARN that the workgroup associates to. * **QueryResultsS3AccessGrantsConfiguration** *(dict) --* Specifies whether Amazon S3 access grants are enabled for query results. * **EnableS3AccessGrants** *(boolean) --* **[REQUIRED]** Specifies whether Amazon S3 access grants are enabled for query results. * **CreateUserLevelPrefix** *(boolean) --* When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location. * **AuthenticationType** *(string) --* **[REQUIRED]** The authentication type used for Amazon S3 access grants. Currently, only "DIRECTORY_IDENTITY" is supported. * **Description** (*string*) -- The workgroup description. * **Tags** (*list*) -- A list of comma separated tags to add to the workgroup that is created. * *(dict) --* A label that you assign to a resource. Athena resources include workgroups, data catalogs, and capacity reservations. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena resources by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. * **Key** *(string) --* A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. * **Value** *(string) --* A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_capacity_reservations list_capacity_reservations ************************** Athena.Client.list_capacity_reservations(**kwargs) Lists the capacity reservations for the current account. See also: AWS API Documentation **Request Syntax** response = client.list_capacity_reservations( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. * **MaxResults** (*integer*) -- Specifies the maximum number of results to return. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'CapacityReservations': [ { 'Name': 'string', 'Status': 'PENDING'|'ACTIVE'|'CANCELLING'|'CANCELLED'|'FAILED'|'UPDATE_PENDING', 'TargetDpus': 123, 'AllocatedDpus': 123, 'LastAllocation': { 'Status': 'PENDING'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'RequestTime': datetime(2015, 1, 1), 'RequestCompletionTime': datetime(2015, 1, 1) }, 'LastSuccessfulAllocationTime': datetime(2015, 1, 1), 'CreationTime': datetime(2015, 1, 1) }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. * **CapacityReservations** *(list) --* The capacity reservations for the current account. * *(dict) --* A reservation for a specified number of data processing units (DPUs). When a reservation is initially created, it has no DPUs. Athena allocates DPUs until the allocated amount equals the requested amount. * **Name** *(string) --* The name of the capacity reservation. * **Status** *(string) --* The status of the capacity reservation. * **TargetDpus** *(integer) --* The number of data processing units requested. * **AllocatedDpus** *(integer) --* The number of data processing units currently allocated. * **LastAllocation** *(dict) --* Contains the submission time of a single allocation request for a capacity reservation and the most recent status of the attempted allocation. * **Status** *(string) --* The status of the capacity allocation. * **StatusMessage** *(string) --* The status message of the capacity allocation. * **RequestTime** *(datetime) --* The time when the capacity allocation was requested. * **RequestCompletionTime** *(datetime) --* The time when the capacity allocation request was completed. * **LastSuccessfulAllocationTime** *(datetime) --* The time of the most recent capacity allocation that succeeded. * **CreationTime** *(datetime) --* The time in UTC epoch millis when the capacity reservation was created. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / list_engine_versions list_engine_versions ******************** Athena.Client.list_engine_versions(**kwargs) Returns a list of engine versions that are available to choose from, including the Auto option. See also: AWS API Documentation **Request Syntax** response = client.list_engine_versions( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **MaxResults** (*integer*) -- The maximum number of engine versions to return in this request. Return type: dict Returns: **Response Syntax** { 'EngineVersions': [ { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **EngineVersions** *(list) --* A list of engine versions that are available to choose from. * *(dict) --* The Athena engine version for running queries, or the PySpark engine version for running sessions. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / delete_capacity_reservation delete_capacity_reservation *************************** Athena.Client.delete_capacity_reservation(**kwargs) Deletes a cancelled capacity reservation. A reservation must be cancelled before it can be deleted. A deleted reservation is immediately removed from your account and can no longer be referenced, including by its ARN. A deleted reservation cannot be called by "GetCapacityReservation", and deleted reservations do not appear in the output of "ListCapacityReservations". See also: AWS API Documentation **Request Syntax** response = client.delete_capacity_reservation( Name='string' ) Parameters: **Name** (*string*) -- **[REQUIRED]** The name of the capacity reservation to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / get_query_execution get_query_execution ******************* Athena.Client.get_query_execution(**kwargs) Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID. See also: AWS API Documentation **Request Syntax** response = client.get_query_execution( QueryExecutionId='string' ) Parameters: **QueryExecutionId** (*string*) -- **[REQUIRED]** The unique ID of the query execution. Return type: dict Returns: **Response Syntax** { 'QueryExecution': { 'QueryExecutionId': 'string', 'Query': 'string', 'StatementType': 'DDL'|'DML'|'UTILITY', 'ManagedQueryResultsConfiguration': { 'Enabled': True|False, 'EncryptionConfiguration': { 'KmsKey': 'string' } }, 'ResultConfiguration': { 'OutputLocation': 'string', 'EncryptionConfiguration': { 'EncryptionOption': 'SSE_S3'|'SSE_KMS'|'CSE_KMS', 'KmsKey': 'string' }, 'ExpectedBucketOwner': 'string', 'AclConfiguration': { 'S3AclOption': 'BUCKET_OWNER_FULL_CONTROL' } }, 'ResultReuseConfiguration': { 'ResultReuseByAgeConfiguration': { 'Enabled': True|False, 'MaxAgeInMinutes': 123 } }, 'QueryExecutionContext': { 'Database': 'string', 'Catalog': 'string' }, 'Status': { 'State': 'QUEUED'|'RUNNING'|'SUCCEEDED'|'FAILED'|'CANCELLED', 'StateChangeReason': 'string', 'SubmissionDateTime': datetime(2015, 1, 1), 'CompletionDateTime': datetime(2015, 1, 1), 'AthenaError': { 'ErrorCategory': 123, 'ErrorType': 123, 'Retryable': True|False, 'ErrorMessage': 'string' } }, 'Statistics': { 'EngineExecutionTimeInMillis': 123, 'DataScannedInBytes': 123, 'DataManifestLocation': 'string', 'TotalExecutionTimeInMillis': 123, 'QueryQueueTimeInMillis': 123, 'ServicePreProcessingTimeInMillis': 123, 'QueryPlanningTimeInMillis': 123, 'ServiceProcessingTimeInMillis': 123, 'ResultReuseInformation': { 'ReusedPreviousResult': True|False } }, 'WorkGroup': 'string', 'EngineVersion': { 'SelectedEngineVersion': 'string', 'EffectiveEngineVersion': 'string' }, 'ExecutionParameters': [ 'string', ], 'SubstatementType': 'string', 'QueryResultsS3AccessGrantsConfiguration': { 'EnableS3AccessGrants': True|False, 'CreateUserLevelPrefix': True|False, 'AuthenticationType': 'DIRECTORY_IDENTITY' } } } **Response Structure** * *(dict) --* * **QueryExecution** *(dict) --* Information about the query execution. * **QueryExecutionId** *(string) --* The unique identifier for each query execution. * **Query** *(string) --* The SQL query statements which the query execution ran. * **StatementType** *(string) --* The type of query statement that was run. "DDL" indicates DDL query statements. "DML" indicates DML (Data Manipulation Language) query statements, such as "CREATE TABLE AS SELECT". "UTILITY" indicates query statements other than DDL and DML, such as "SHOW CREATE TABLE", or "DESCRIBE TABLE". * **ManagedQueryResultsConfiguration** *(dict) --* The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. * **Enabled** *(boolean) --* If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under "ResultConfiguration$OutputLocation". The default is false. A workgroup cannot have the "ResultConfiguration$OutputLocation" parameter when you set this field to true. * **EncryptionConfiguration** *(dict) --* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for example, SSE_KMS or CSE_KMS) and key information. * **KmsKey** *(string) --* The ARN of an KMS key for encrypting managed query results. * **ResultConfiguration** *(dict) --* The location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. * **OutputLocation** *(string) --* The location in Amazon S3 where your query and calculation results are stored, such as "s3://path/to/query/bucket/". To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. * **EncryptionConfiguration** *(dict) --* If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, "SSE_KMS" or "CSE_KMS") and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **EncryptionOption** *(string) --* Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys ( "SSE_S3"), server-side encryption with KMS-managed keys ( "SSE_KMS"), or client-side encryption with KMS-managed keys ( "CSE_KMS") is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. * **KmsKey** *(string) --* For "SSE_KMS" and "CSE_KMS", this is the KMS key ARN or ID. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that you expect to be the owner of the Amazon S3 bucket specified by ResultConfiguration$OutputLocation. If set, Athena uses the value for "ExpectedBucketOwner" when it makes Amazon S3 calls to your specified output location. If the "ExpectedBucketOwner" Amazon Web Services account ID does not match the actual owner of the Amazon S3 bucket, the call fails with a permissions error. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the "ExpectedBucketOwner" setting that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **AclConfiguration** *(dict) --* Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". This is a client-side setting. If workgroup settings override client-side settings, then the query uses the ACL configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. For more information, see WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings. * **S3AclOption** *(string) --* The Amazon S3 canned ACL that Athena should specify when storing query results, including data files inserted by Athena as the result of statements like CTAS or INSERT INTO. Currently the only supported canned ACL is "BUCKET_OWNER_FULL_CONTROL". If a query runs in a workgroup and the workgroup overrides client-side settings, then the Amazon S3 canned ACL specified in the workgroup's settings is used for all queries that run in the workgroup. For more information about Amazon S3 canned ACLs, see Canned ACL in the *Amazon S3 User Guide*. * **ResultReuseConfiguration** *(dict) --* Specifies the query result reuse behavior that was used for the query. * **ResultReuseByAgeConfiguration** *(dict) --* Specifies whether previous query results are reused, and if so, their maximum age. * **Enabled** *(boolean) --* True if previous query results can be reused when the query is run; otherwise, false. The default is false. * **MaxAgeInMinutes** *(integer) --* Specifies, in minutes, the maximum age of a previous query result that Athena should consider for reuse. The default is 60. * **QueryExecutionContext** *(dict) --* The database in which the query execution occurred. * **Database** *(string) --* The name of the database used in the query execution. The database must exist in the catalog. * **Catalog** *(string) --* The name of the data catalog used in the query execution. * **Status** *(dict) --* The completion date, current state, submission time, and state change reason (if applicable) for the query execution. * **State** *(string) --* The state of query execution. "QUEUED" indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. "RUNNING" indicates that the query is in execution phase. "SUCCEEDED" indicates that the query completed without errors. "FAILED" indicates that the query experienced an error and did not complete processing. "CANCELLED" indicates that a user input interrupted query execution. Note: Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from "RUNNING" or "FAILED" to "QUEUED". * **StateChangeReason** *(string) --* Further detail about the status of the query. * **SubmissionDateTime** *(datetime) --* The date and time that the query was submitted. * **CompletionDateTime** *(datetime) --* The date and time that the query completed. * **AthenaError** *(dict) --* Provides information about an Athena query error. * **ErrorCategory** *(integer) --* An integer value that specifies the category of a query failure error. The following list shows the category for each integer value. **1** - System **2** - User **3** - Other * **ErrorType** *(integer) --* An integer value that provides specific information about an Athena query error. For the meaning of specific values, see the Error Type Reference in the *Amazon Athena User Guide*. * **Retryable** *(boolean) --* True if the query might succeed if resubmitted. * **ErrorMessage** *(string) --* Contains a short description of the error that occurred. * **Statistics** *(dict) --* Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run. * **EngineExecutionTimeInMillis** *(integer) --* The number of milliseconds that the query took to execute. * **DataScannedInBytes** *(integer) --* The number of bytes in the data that was queried. * **DataManifestLocation** *(string) --* The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see Working with Query Results, Output Files, and Query History in the *Amazon Athena User Guide*. * **TotalExecutionTimeInMillis** *(integer) --* The number of milliseconds that Athena took to run the query. * **QueryQueueTimeInMillis** *(integer) --* The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue. * **ServicePreProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena took to preprocess the query before submitting the query to the query engine. * **QueryPlanningTimeInMillis** *(integer) --* The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time. * **ServiceProcessingTimeInMillis** *(integer) --* The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query. * **ResultReuseInformation** *(dict) --* Contains information about whether previous query results were reused for the query. * **ReusedPreviousResult** *(boolean) --* True if a previous query result was reused; false if the result was generated from a new run of the query. * **WorkGroup** *(string) --* The name of the workgroup in which the query ran. * **EngineVersion** *(dict) --* The engine version that executed the query. * **SelectedEngineVersion** *(string) --* The engine version requested by the user. Possible values are determined by the output of "ListEngineVersions", including AUTO. The default is AUTO. * **EffectiveEngineVersion** *(string) --* Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a "CreateWorkGroup" or "UpdateWorkGroup" operation, the "EffectiveEngineVersion" field is ignored. * **ExecutionParameters** *(list) --* A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur. The list of parameters is not returned in the response. * *(string) --* * **SubstatementType** *(string) --* The kind of query statement that was run. * **QueryResultsS3AccessGrantsConfiguration** *(dict) --* Specifies whether Amazon S3 access grants are enabled for query results. * **EnableS3AccessGrants** *(boolean) --* Specifies whether Amazon S3 access grants are enabled for query results. * **CreateUserLevelPrefix** *(boolean) --* When enabled, appends the user ID as an Amazon S3 path prefix to the query result output location. * **AuthenticationType** *(string) --* The authentication type used for Amazon S3 access grants. Currently, only "DIRECTORY_IDENTITY" is supported. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / delete_data_catalog delete_data_catalog ******************* Athena.Client.delete_data_catalog(**kwargs) Deletes a data catalog. See also: AWS API Documentation **Request Syntax** response = client.delete_data_catalog( Name='string', DeleteCatalogOnly=True|False ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the data catalog to delete. * **DeleteCatalogOnly** (*boolean*) -- Deletes the Athena Data Catalog. You can only use this with the "FEDERATED" catalogs. You usually perform this before registering the connector with Glue Data Catalog. After deletion, you will have to manage the Glue Connection and Lambda function. Return type: dict Returns: **Response Syntax** { 'DataCatalog': { 'Name': 'string', 'Description': 'string', 'Type': 'LAMBDA'|'GLUE'|'HIVE'|'FEDERATED', 'Parameters': { 'string': 'string' }, 'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'CREATE_FAILED_CLEANUP_IN_PROGRESS'|'CREATE_FAILED_CLEANUP_COMPLETE'|'CREATE_FAILED_CLEANUP_FAILED'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED', 'ConnectionType': 'DYNAMODB'|'MYSQL'|'POSTGRESQL'|'REDSHIFT'|'ORACLE'|'SYNAPSE'|'SQLSERVER'|'DB2'|'OPENSEARCH'|'BIGQUERY'|'GOOGLECLOUDSTORAGE'|'HBASE'|'DOCUMENTDB'|'CMDB'|'TPCDS'|'TIMESTREAM'|'SAPHANA'|'SNOWFLAKE'|'DATALAKEGEN2'|'DB2AS400', 'Error': 'string' } } **Response Structure** * *(dict) --* * **DataCatalog** *(dict) --* Contains information about a data catalog in an Amazon Web Services account. Note: In the Athena console, data catalogs are listed as "data sources" on the **Data sources** page under the **Data source name** column. * **Name** *(string) --* The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena. * **Description** *(string) --* An optional description of the data catalog. * **Type** *(string) --* The type of data catalog to create: "LAMBDA" for a federated catalog, "GLUE" for an Glue Data Catalog, and "HIVE" for an external Apache Hive metastore. "FEDERATED" is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass. * **Parameters** *(dict) --* Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type. * For the "HIVE" data catalog type, use the following syntax. The "metadata-function" parameter is required. "The sdk-version" parameter is optional and defaults to the currently supported version. "metadata- function=lambda_arn, sdk-version=version_number" * For the "LAMBDA" data catalog type, use one of the following sets of required parameters, but not both. * If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required. "metadata-function=lambda_arn, record- function=lambda_arn" * If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function. "function=lambda_arn" * The "GLUE" type takes a catalog ID parameter and is required. The "catalog_id" is the account ID of the Amazon Web Services account to which the Glue catalog belongs. "catalog-id=catalog_id" * The "GLUE" data catalog type also applies to the default "AwsDataCatalog" that already exists in your account, of which you can have only one and cannot modify. * The "FEDERATED" data catalog type uses one of the following parameters, but not both. Use "connection-arn" for an existing Glue connection. Use "connection-type" and "connection-properties" to specify the configuration setting for a new connection. * "connection-arn:" * "connection-type:MYSQL|REDSHIFT|...., connection- properties:""" For "" , use escaped JSON text, as in the following example. ""{\"spill_bucket\":\"my_spill\",\"spill_prefix \":\"athena-spill\",\"host\":\"abc12345.snowflakecomp uting.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\ ",\"database\":\"TEST\",\"schema\":\"PUBLIC\",\"Secre tArn\":\"arn:aws:secretsmanager:ap- south-1:111122223333:secret:snowflake-XHb67j\"}"" * *(string) --* * *(string) --* * **Status** *(string) --* The status of the creation or deletion of the data catalog. * The "LAMBDA", "GLUE", and "HIVE" data catalog types are created synchronously. Their status is either "CREATE_COMPLETE" or "CREATE_FAILED". * The "FEDERATED" data catalog type is created asynchronously. Data catalog creation status: * "CREATE_IN_PROGRESS": Federated data catalog creation in progress. * "CREATE_COMPLETE": Data catalog creation complete. * "CREATE_FAILED": Data catalog could not be created. * "CREATE_FAILED_CLEANUP_IN_PROGRESS": Federated data catalog creation failed and is being removed. * "CREATE_FAILED_CLEANUP_COMPLETE": Federated data catalog creation failed and was removed. * "CREATE_FAILED_CLEANUP_FAILED": Federated data catalog creation failed but could not be removed. Data catalog deletion status: * "DELETE_IN_PROGRESS": Federated data catalog deletion in progress. * "DELETE_COMPLETE": Federated data catalog deleted. * "DELETE_FAILED": Federated data catalog could not be deleted. * **ConnectionType** *(string) --* The type of connection for a "FEDERATED" data catalog (for example, "REDSHIFT", "MYSQL", or "SQLSERVER"). For information about individual connectors, see Available data source connectors. * **Error** *(string) --* Text of the error that occurred during data catalog creation or deletion. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" Athena / Client / get_session_status get_session_status ****************** Athena.Client.get_session_status(**kwargs) Gets the current status of a session. See also: AWS API Documentation **Request Syntax** response = client.get_session_status( SessionId='string' ) Parameters: **SessionId** (*string*) -- **[REQUIRED]** The session ID. Return type: dict Returns: **Response Syntax** { 'SessionId': 'string', 'Status': { 'StartDateTime': datetime(2015, 1, 1), 'LastModifiedDateTime': datetime(2015, 1, 1), 'EndDateTime': datetime(2015, 1, 1), 'IdleSinceDateTime': datetime(2015, 1, 1), 'State': 'CREATING'|'CREATED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'DEGRADED'|'FAILED', 'StateChangeReason': 'string' } } **Response Structure** * *(dict) --* * **SessionId** *(string) --* The session ID. * **Status** *(dict) --* Contains information about the status of the session. * **StartDateTime** *(datetime) --* The date and time that the session started. * **LastModifiedDateTime** *(datetime) --* The most recent date and time that the session was modified. * **EndDateTime** *(datetime) --* The date and time that the session ended. * **IdleSinceDateTime** *(datetime) --* The date and time starting at which the session became idle. Can be empty if the session is not currently idle. * **State** *(string) --* The state of the session. A description of each state follows. "CREATING" - The session is being started, including acquiring resources. "CREATED" - The session has been started. "IDLE" - The session is able to accept a calculation. "BUSY" - The session is processing another task and is unable to accept a calculation. "TERMINATING" - The session is in the process of shutting down. "TERMINATED" - The session and its resources are no longer running. "DEGRADED" - The session has no healthy coordinators. "FAILED" - Due to a failure, the session and its resources are no longer running. * **StateChangeReason** *(string) --* The reason for the session state change (for example, canceled because the session was terminated). **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / list_executors list_executors ************** Athena.Client.list_executors(**kwargs) Lists, in descending order, the executors that joined a session. Newer executors are listed first; older executors are listed later. The result can be optionally filtered by state. See also: AWS API Documentation **Request Syntax** response = client.list_executors( SessionId='string', ExecutorStateFilter='CREATING'|'CREATED'|'REGISTERED'|'TERMINATING'|'TERMINATED'|'FAILED', MaxResults=123, NextToken='string' ) Parameters: * **SessionId** (*string*) -- **[REQUIRED]** The session ID. * **ExecutorStateFilter** (*string*) -- A filter for a specific executor state. A description of each state follows. "CREATING" - The executor is being started, including acquiring resources. "CREATED" - The executor has been started. "REGISTERED" - The executor has been registered. "TERMINATING" - The executor is in the process of shutting down. "TERMINATED" - The executor is no longer running. "FAILED" - Due to a failure, the executor is no longer running. * **MaxResults** (*integer*) -- The maximum number of executors to return. * **NextToken** (*string*) -- A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. Return type: dict Returns: **Response Syntax** { 'SessionId': 'string', 'NextToken': 'string', 'ExecutorsSummary': [ { 'ExecutorId': 'string', 'ExecutorType': 'COORDINATOR'|'GATEWAY'|'WORKER', 'StartDateTime': 123, 'TerminationDateTime': 123, 'ExecutorState': 'CREATING'|'CREATED'|'REGISTERED'|'TERMINATING'|'TERMINATED'|'FAILED', 'ExecutorSize': 123 }, ] } **Response Structure** * *(dict) --* * **SessionId** *(string) --* The session ID. * **NextToken** *(string) --* A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the "NextToken" from the response object of the previous page call. * **ExecutorsSummary** *(list) --* Contains summary information about the executor. * *(dict) --* Contains summary information about an executor. * **ExecutorId** *(string) --* The UUID of the executor. * **ExecutorType** *(string) --* The type of executor used for the application ( "COORDINATOR", "GATEWAY", or "WORKER"). * **StartDateTime** *(integer) --* The date and time that the executor started. * **TerminationDateTime** *(integer) --* The date and time that the executor was terminated. * **ExecutorState** *(string) --* The processing state of the executor. A description of each state follows. "CREATING" - The executor is being started, including acquiring resources. "CREATED" - The executor has been started. "REGISTERED" - The executor has been registered. "TERMINATING" - The executor is in the process of shutting down. "TERMINATED" - The executor is no longer running. "FAILED" - Due to a failure, the executor is no longer running. * **ExecutorSize** *(integer) --* The smallest unit of compute that a session can request from Athena. Size is measured in data processing unit (DPU) values, a relative measure of processing power. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException" Athena / Client / update_capacity_reservation update_capacity_reservation *************************** Athena.Client.update_capacity_reservation(**kwargs) Updates the number of requested data processing units for the capacity reservation with the specified name. See also: AWS API Documentation **Request Syntax** response = client.update_capacity_reservation( TargetDpus=123, Name='string' ) Parameters: * **TargetDpus** (*integer*) -- **[REQUIRED]** The new number of requested data processing units. * **Name** (*string*) -- **[REQUIRED]** The name of the capacity reservation. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.InternalServerException" Athena / Client / stop_calculation_execution stop_calculation_execution ************************** Athena.Client.stop_calculation_execution(**kwargs) Requests the cancellation of a calculation. A "StopCalculationExecution" call on a calculation that is already in a terminal state (for example, "STOPPED", "FAILED", or "COMPLETED") succeeds but has no effect. Note: Cancelling a calculation is done on a best effort basis. If a calculation cannot be cancelled, you can be charged for its completion. If you are concerned about being charged for a calculation that cannot be cancelled, consider terminating the session in which the calculation is running. See also: AWS API Documentation **Request Syntax** response = client.stop_calculation_execution( CalculationExecutionId='string' ) Parameters: **CalculationExecutionId** (*string*) -- **[REQUIRED]** The calculation execution UUID. Return type: dict Returns: **Response Syntax** { 'State': 'CREATING'|'CREATED'|'QUEUED'|'RUNNING'|'CANCELING'|'CANCELED'|'COMPLETED'|'FAILED' } **Response Structure** * *(dict) --* * **State** *(string) --* "CREATING" - The calculation is in the process of being created. "CREATED" - The calculation has been created and is ready to run. "QUEUED" - The calculation has been queued for processing. "RUNNING" - The calculation is running. "CANCELING" - A request to cancel the calculation has been received and the system is working to stop it. "CANCELED" - The calculation is no longer running as the result of a cancel request. "COMPLETED" - The calculation has completed without error. "FAILED" - The calculation failed and is no longer running. **Exceptions** * "Athena.Client.exceptions.InternalServerException" * "Athena.Client.exceptions.InvalidRequestException" * "Athena.Client.exceptions.ResourceNotFoundException"