Amazon Athena 2017-05-18
- Client: Aws\Athena\AthenaClient
- Service ID: athena
- Version: 2017-05-18
This page describes the parameters and results for the operations of the Amazon Athena (2017-05-18), and shows how to use the Aws\Athena\AthenaClient object to call the described operations. This documentation is specific to the 2017-05-18 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- BatchGetNamedQuery ( array $params = [] )
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.
- BatchGetQueryExecution ( array $params = [] )
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.
- CreateDataCatalog ( array $params = [] )
Creates (registers) a data catalog with the specified name and properties.
- CreateNamedQuery ( array $params = [] )
Creates a named query in the specified workgroup.
- CreateWorkGroup ( array $params = [] )
Creates a workgroup with the specified name.
- DeleteDataCatalog ( array $params = [] )
Deletes a data catalog.
- DeleteNamedQuery ( array $params = [] )
Deletes the named query if you have access to the workgroup in which the query was saved.
- DeleteWorkGroup ( array $params = [] )
Deletes the workgroup with the specified name.
- GetDataCatalog ( array $params = [] )
Returns the specified data catalog.
- GetDatabase ( array $params = [] )
Returns a database object for the specfied database and data catalog.
- GetNamedQuery ( array $params = [] )
Returns information about a single query.
- GetQueryExecution ( array $params = [] )
Returns information about a single execution of a query if you have access to the workgroup in which the query ran.
- GetQueryResults ( array $params = [] )
Streams the results of a single query execution specified by QueryExecutionId from the Athena query results location in Amazon S3.
- GetTableMetadata ( array $params = [] )
Returns table metadata for the specified catalog, database, and table.
- GetWorkGroup ( array $params = [] )
Returns information about the workgroup with the specified name.
- ListDataCatalogs ( array $params = [] )
Lists the data catalogs in the current AWS account.
- ListDatabases ( array $params = [] )
Lists the databases in the specified data catalog.
- ListNamedQueries ( array $params = [] )
Provides a list of available query IDs only for queries saved in the specified workgroup.
- ListQueryExecutions ( array $params = [] )
Provides a list of available query execution IDs for the queries in the specified workgroup.
- ListTableMetadata ( array $params = [] )
Lists the metadata for the tables in the specified data catalog database.
- ListTagsForResource ( array $params = [] )
Lists the tags associated with an Athena workgroup or data catalog resource.
- ListWorkGroups ( array $params = [] )
Lists available workgroups for the account.
- StartQueryExecution ( array $params = [] )
Runs the SQL query statements contained in the Query.
- StopQueryExecution ( array $params = [] )
Stops a query execution.
- TagResource ( array $params = [] )
Adds one or more tags to an Athena resource.
- UntagResource ( array $params = [] )
Removes one or more tags from a data catalog or workgroup resource.
- UpdateDataCatalog ( array $params = [] )
Updates the data catalog that has the specified name.
- UpdateWorkGroup ( array $params = [] )
Updates the workgroup with the specified name.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
BatchGetNamedQuery
$result = $client->batchGetNamedQuery
([/* ... */]); $promise = $client->batchGetNamedQueryAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->batchGetNamedQuery([ 'NamedQueryIds' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Result Syntax
[ 'NamedQueries' => [ [ 'Database' => '<string>', 'Description' => '<string>', 'Name' => '<string>', 'NamedQueryId' => '<string>', 'QueryString' => '<string>', 'WorkGroup' => '<string>', ], // ... ], 'UnprocessedNamedQueryIds' => [ [ 'ErrorCode' => '<string>', 'ErrorMessage' => '<string>', 'NamedQueryId' => '<string>', ], // ... ], ]
Result Details
Members
- NamedQueries
-
- Type: Array of NamedQuery structures
Information about the named query IDs submitted.
- UnprocessedNamedQueryIds
-
- Type: Array of UnprocessedNamedQueryId structures
Information about provided query IDs.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
BatchGetQueryExecution
$result = $client->batchGetQueryExecution
([/* ... */]); $promise = $client->batchGetQueryExecutionAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->batchGetQueryExecution([ 'QueryExecutionIds' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Result Syntax
[ 'QueryExecutions' => [ [ 'Query' => '<string>', 'QueryExecutionContext' => [ 'Catalog' => '<string>', 'Database' => '<string>', ], 'QueryExecutionId' => '<string>', 'ResultConfiguration' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', ], 'StatementType' => 'DDL|DML|UTILITY', 'Statistics' => [ 'DataManifestLocation' => '<string>', 'DataScannedInBytes' => <integer>, 'EngineExecutionTimeInMillis' => <integer>, 'QueryPlanningTimeInMillis' => <integer>, 'QueryQueueTimeInMillis' => <integer>, 'ServiceProcessingTimeInMillis' => <integer>, 'TotalExecutionTimeInMillis' => <integer>, ], 'Status' => [ 'CompletionDateTime' => <DateTime>, 'State' => 'QUEUED|RUNNING|SUCCEEDED|FAILED|CANCELLED', 'StateChangeReason' => '<string>', 'SubmissionDateTime' => <DateTime>, ], 'WorkGroup' => '<string>', ], // ... ], 'UnprocessedQueryExecutionIds' => [ [ 'ErrorCode' => '<string>', 'ErrorMessage' => '<string>', 'QueryExecutionId' => '<string>', ], // ... ], ]
Result Details
Members
- QueryExecutions
-
- Type: Array of QueryExecution structures
Information about a query execution.
- UnprocessedQueryExecutionIds
-
- Type: Array of UnprocessedQueryExecutionId structures
Information about the query executions that failed to run.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
CreateDataCatalog
$result = $client->createDataCatalog
([/* ... */]); $promise = $client->createDataCatalogAsync
([/* ... */]);
Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same AWS account.
Parameter Syntax
$result = $client->createDataCatalog([ 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'Parameters' => ['<string>', ...], 'Tags' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], 'Type' => 'LAMBDA|GLUE|HIVE', // REQUIRED ]);
Parameter Details
Members
- Description
-
- Type: string
A description of the data catalog to be created.
- Name
-
- Required: Yes
- Type: string
The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
- Parameters
-
- Type: Associative array of custom strings keys (KeyString) to strings
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. Themetadata-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 has no parameters.
- Tags
-
- Type: Array of Tag structures
A list of comma separated tags to add to the data catalog that is created.
- Type
-
- Required: Yes
- Type: string
The type of data catalog to create:
LAMBDA
for a federated catalog,GLUE
for AWS Glue Catalog, orHIVE
for an external hive metastore.
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
CreateNamedQuery
$result = $client->createNamedQuery
([/* ... */]); $promise = $client->createNamedQueryAsync
([/* ... */]);
Creates a named query in the specified workgroup. Requires that you have access to the workgroup.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->createNamedQuery([ 'ClientRequestToken' => '<string>', 'Database' => '<string>', // REQUIRED 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'QueryString' => '<string>', // REQUIRED 'WorkGroup' => '<string>', ]);
Parameter Details
Members
- ClientRequestToken
-
- Type: 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, theQueryString
, an error is returned.This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.
- Database
-
- Required: Yes
- Type: string
The database to which the query belongs.
- Description
-
- Type: string
The query description.
- Name
-
- Required: Yes
- Type: string
The query name.
- QueryString
-
- Required: Yes
- Type: string
The contents of the query with all query statements.
- WorkGroup
-
- Type: string
The name of the workgroup in which the named query is being created.
Result Syntax
[ 'NamedQueryId' => '<string>', ]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
CreateWorkGroup
$result = $client->createWorkGroup
([/* ... */]); $promise = $client->createWorkGroupAsync
([/* ... */]);
Creates a workgroup with the specified name.
Parameter Syntax
$result = $client->createWorkGroup([ 'Configuration' => [ 'BytesScannedCutoffPerQuery' => <integer>, 'EnforceWorkGroupConfiguration' => true || false, 'PublishCloudWatchMetricsEnabled' => true || false, 'RequesterPaysEnabled' => true || false, 'ResultConfiguration' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', // REQUIRED 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', ], ], 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'Tags' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ]);
Parameter Details
Members
- Configuration
-
- Type: WorkGroupConfiguration structure
The configuration for the workgroup, which includes the location in Amazon S3 where query 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.
- Description
-
- Type: string
The workgroup description.
- Name
-
- Required: Yes
- Type: string
The workgroup name.
- Tags
-
- Type: Array of Tag structures
A list of comma separated tags to add to the workgroup that is created.
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
DeleteDataCatalog
$result = $client->deleteDataCatalog
([/* ... */]); $promise = $client->deleteDataCatalogAsync
([/* ... */]);
Deletes a data catalog.
Parameter Syntax
$result = $client->deleteDataCatalog([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
DeleteNamedQuery
$result = $client->deleteNamedQuery
([/* ... */]); $promise = $client->deleteNamedQueryAsync
([/* ... */]);
Deletes the named query if you have access to the workgroup in which the query was saved.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->deleteNamedQuery([ 'NamedQueryId' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
DeleteWorkGroup
$result = $client->deleteWorkGroup
([/* ... */]); $promise = $client->deleteWorkGroupAsync
([/* ... */]);
Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.
Parameter Syntax
$result = $client->deleteWorkGroup([ 'RecursiveDeleteOption' => true || false, 'WorkGroup' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
GetDataCatalog
$result = $client->getDataCatalog
([/* ... */]); $promise = $client->getDataCatalogAsync
([/* ... */]);
Returns the specified data catalog.
Parameter Syntax
$result = $client->getDataCatalog([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'DataCatalog' => [ 'Description' => '<string>', 'Name' => '<string>', 'Parameters' => ['<string>', ...], 'Type' => 'LAMBDA|GLUE|HIVE', ], ]
Result Details
Members
- DataCatalog
-
- Type: DataCatalog structure
The data catalog returned.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
GetDatabase
$result = $client->getDatabase
([/* ... */]); $promise = $client->getDatabaseAsync
([/* ... */]);
Returns a database object for the specfied database and data catalog.
Parameter Syntax
$result = $client->getDatabase([ 'CatalogName' => '<string>', // REQUIRED 'DatabaseName' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Database' => [ 'Description' => '<string>', 'Name' => '<string>', 'Parameters' => ['<string>', ...], ], ]
Result Details
Members
- Database
-
- Type: Database structure
The database returned.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (
InvalidRequestException
) or from the Athena platform (InternalServerException
). For example, if a user-created Lambda function is missing permissions, the Lambda4XX
exception is returned in aMetadataException
.
GetNamedQuery
$result = $client->getNamedQuery
([/* ... */]); $promise = $client->getNamedQueryAsync
([/* ... */]);
Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.
Parameter Syntax
$result = $client->getNamedQuery([ 'NamedQueryId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- NamedQueryId
-
- Required: Yes
- Type: string
The unique ID of the query. Use ListNamedQueries to get query IDs.
Result Syntax
[ 'NamedQuery' => [ 'Database' => '<string>', 'Description' => '<string>', 'Name' => '<string>', 'NamedQueryId' => '<string>', 'QueryString' => '<string>', 'WorkGroup' => '<string>', ], ]
Result Details
Members
- NamedQuery
-
- Type: NamedQuery structure
Information about the query.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
GetQueryExecution
$result = $client->getQueryExecution
([/* ... */]); $promise = $client->getQueryExecutionAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->getQueryExecution([ 'QueryExecutionId' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'QueryExecution' => [ 'Query' => '<string>', 'QueryExecutionContext' => [ 'Catalog' => '<string>', 'Database' => '<string>', ], 'QueryExecutionId' => '<string>', 'ResultConfiguration' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', ], 'StatementType' => 'DDL|DML|UTILITY', 'Statistics' => [ 'DataManifestLocation' => '<string>', 'DataScannedInBytes' => <integer>, 'EngineExecutionTimeInMillis' => <integer>, 'QueryPlanningTimeInMillis' => <integer>, 'QueryQueueTimeInMillis' => <integer>, 'ServiceProcessingTimeInMillis' => <integer>, 'TotalExecutionTimeInMillis' => <integer>, ], 'Status' => [ 'CompletionDateTime' => <DateTime>, 'State' => 'QUEUED|RUNNING|SUCCEEDED|FAILED|CANCELLED', 'StateChangeReason' => '<string>', 'SubmissionDateTime' => <DateTime>, ], 'WorkGroup' => '<string>', ], ]
Result Details
Members
- QueryExecution
-
- Type: QueryExecution structure
Information about the query execution.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
GetQueryResults
$result = $client->getQueryResults
([/* ... */]); $promise = $client->getQueryResultsAsync
([/* ... */]);
Streams the results of a single query execution specified by QueryExecutionId
from the Athena query results location in Amazon S3. For more information, see Query Results 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.
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.
Parameter Syntax
$result = $client->getQueryResults([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'QueryExecutionId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of results (rows) to return in this request.
- NextToken
-
- Type: 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. - QueryExecutionId
-
- Required: Yes
- Type: string
The unique ID of the query execution.
Result Syntax
[ 'NextToken' => '<string>', 'ResultSet' => [ 'ResultSetMetadata' => [ 'ColumnInfo' => [ [ 'CaseSensitive' => true || false, 'CatalogName' => '<string>', 'Label' => '<string>', 'Name' => '<string>', 'Nullable' => 'NOT_NULL|NULLABLE|UNKNOWN', 'Precision' => <integer>, 'Scale' => <integer>, 'SchemaName' => '<string>', 'TableName' => '<string>', 'Type' => '<string>', ], // ... ], ], 'Rows' => [ [ 'Data' => [ [ 'VarCharValue' => '<string>', ], // ... ], ], // ... ], ], 'UpdateCount' => <integer>, ]
Result Details
Members
- NextToken
-
- Type: 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. - ResultSet
-
- Type: ResultSet structure
The results of the query execution.
- UpdateCount
-
- Type: long (int|float)
The number of rows inserted with a CREATE TABLE AS SELECT statement.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
GetTableMetadata
$result = $client->getTableMetadata
([/* ... */]); $promise = $client->getTableMetadataAsync
([/* ... */]);
Returns table metadata for the specified catalog, database, and table.
Parameter Syntax
$result = $client->getTableMetadata([ 'CatalogName' => '<string>', // REQUIRED 'DatabaseName' => '<string>', // REQUIRED 'TableName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- CatalogName
-
- Required: Yes
- Type: string
The name of the data catalog that contains the database and table metadata to return.
- DatabaseName
-
- Required: Yes
- Type: string
The name of the database that contains the table metadata to return.
- TableName
-
- Required: Yes
- Type: string
The name of the table for which metadata is returned.
Result Syntax
[ 'TableMetadata' => [ 'Columns' => [ [ 'Comment' => '<string>', 'Name' => '<string>', 'Type' => '<string>', ], // ... ], 'CreateTime' => <DateTime>, 'LastAccessTime' => <DateTime>, 'Name' => '<string>', 'Parameters' => ['<string>', ...], 'PartitionKeys' => [ [ 'Comment' => '<string>', 'Name' => '<string>', 'Type' => '<string>', ], // ... ], 'TableType' => '<string>', ], ]
Result Details
Members
- TableMetadata
-
- Type: TableMetadata structure
An object that contains table metadata.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (
InvalidRequestException
) or from the Athena platform (InternalServerException
). For example, if a user-created Lambda function is missing permissions, the Lambda4XX
exception is returned in aMetadataException
.
GetWorkGroup
$result = $client->getWorkGroup
([/* ... */]); $promise = $client->getWorkGroupAsync
([/* ... */]);
Returns information about the workgroup with the specified name.
Parameter Syntax
$result = $client->getWorkGroup([ 'WorkGroup' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'WorkGroup' => [ 'Configuration' => [ 'BytesScannedCutoffPerQuery' => <integer>, 'EnforceWorkGroupConfiguration' => true || false, 'PublishCloudWatchMetricsEnabled' => true || false, 'RequesterPaysEnabled' => true || false, 'ResultConfiguration' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', ], ], 'CreationTime' => <DateTime>, 'Description' => '<string>', 'Name' => '<string>', 'State' => 'ENABLED|DISABLED', ], ]
Result Details
Members
- WorkGroup
-
- Type: WorkGroup structure
Information about the workgroup.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
ListDataCatalogs
$result = $client->listDataCatalogs
([/* ... */]); $promise = $client->listDataCatalogsAsync
([/* ... */]);
Lists the data catalogs in the current AWS account.
Parameter Syntax
$result = $client->listDataCatalogs([ 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- MaxResults
-
- Type: int
Specifies the maximum number of data catalogs to return.
- NextToken
-
- Type: 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.
Result Syntax
[ 'DataCatalogsSummary' => [ [ 'CatalogName' => '<string>', 'Type' => 'LAMBDA|GLUE|HIVE', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- DataCatalogsSummary
-
- Type: Array of DataCatalogSummary structures
A summary list of data catalogs.
- NextToken
-
- Type: 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.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
ListDatabases
$result = $client->listDatabases
([/* ... */]); $promise = $client->listDatabasesAsync
([/* ... */]);
Lists the databases in the specified data catalog.
Parameter Syntax
$result = $client->listDatabases([ 'CatalogName' => '<string>', // REQUIRED 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- CatalogName
-
- Required: Yes
- Type: string
The name of the data catalog that contains the databases to return.
- MaxResults
-
- Type: int
Specifies the maximum number of results to return.
- NextToken
-
- Type: 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.
Result Syntax
[ 'DatabaseList' => [ [ 'Description' => '<string>', 'Name' => '<string>', 'Parameters' => ['<string>', ...], ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- DatabaseList
-
- Type: Array of Database structures
A list of databases from a data catalog.
- NextToken
-
- Type: 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.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (
InvalidRequestException
) or from the Athena platform (InternalServerException
). For example, if a user-created Lambda function is missing permissions, the Lambda4XX
exception is returned in aMetadataException
.
ListNamedQueries
$result = $client->listNamedQueries
([/* ... */]); $promise = $client->listNamedQueriesAsync
([/* ... */]);
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.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->listNamedQueries([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'WorkGroup' => '<string>', ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of queries to return in this request.
- NextToken
-
- Type: 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. - WorkGroup
-
- Type: 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.
Result Syntax
[ 'NamedQueryIds' => ['<string>', ...], 'NextToken' => '<string>', ]
Result Details
Members
- NamedQueryIds
-
- Type: Array of strings
The list of unique query IDs.
- NextToken
-
- Type: 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.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
ListQueryExecutions
$result = $client->listQueryExecutions
([/* ... */]); $promise = $client->listQueryExecutionsAsync
([/* ... */]);
Provides a list of available query execution IDs for the queries in the specified workgroup. 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.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->listQueryExecutions([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'WorkGroup' => '<string>', ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of query executions to return in this request.
- NextToken
-
- Type: 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. - WorkGroup
-
- Type: 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.
Result Syntax
[ 'NextToken' => '<string>', 'QueryExecutionIds' => ['<string>', ...], ]
Result Details
Members
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
ListTableMetadata
$result = $client->listTableMetadata
([/* ... */]); $promise = $client->listTableMetadataAsync
([/* ... */]);
Lists the metadata for the tables in the specified data catalog database.
Parameter Syntax
$result = $client->listTableMetadata([ 'CatalogName' => '<string>', // REQUIRED 'DatabaseName' => '<string>', // REQUIRED 'Expression' => '<string>', 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- CatalogName
-
- Required: Yes
- Type: string
The name of the data catalog for which table metadata should be returned.
- DatabaseName
-
- Required: Yes
- Type: string
The name of the database for which table metadata should be returned.
- Expression
-
- Type: string
A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.
- MaxResults
-
- Type: int
Specifies the maximum number of results to return.
- NextToken
-
- Type: 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.
Result Syntax
[ 'NextToken' => '<string>', 'TableMetadataList' => [ [ 'Columns' => [ [ 'Comment' => '<string>', 'Name' => '<string>', 'Type' => '<string>', ], // ... ], 'CreateTime' => <DateTime>, 'LastAccessTime' => <DateTime>, 'Name' => '<string>', 'Parameters' => ['<string>', ...], 'PartitionKeys' => [ [ 'Comment' => '<string>', 'Name' => '<string>', 'Type' => '<string>', ], // ... ], 'TableType' => '<string>', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: 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.
- TableMetadataList
-
- Type: Array of TableMetadata structures
A list of table metadata.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (
InvalidRequestException
) or from the Athena platform (InternalServerException
). For example, if a user-created Lambda function is missing permissions, the Lambda4XX
exception is returned in aMetadataException
.
ListTagsForResource
$result = $client->listTagsForResource
([/* ... */]); $promise = $client->listTagsForResourceAsync
([/* ... */]);
Lists the tags associated with an Athena workgroup or data catalog resource.
Parameter Syntax
$result = $client->listTagsForResource([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ResourceARN' => '<string>', // REQUIRED ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of results to be returned per request that lists the tags for the resource.
- NextToken
-
- Type: 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.
- ResourceARN
-
- Required: Yes
- Type: string
Lists the tags for the resource with the specified ARN.
Result Syntax
[ 'NextToken' => '<string>', 'Tags' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
A token to be used by the next request if this request is truncated.
- Tags
-
- Type: Array of Tag structures
The list of tags associated with the specified resource.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
A resource, such as a workgroup, was not found.
ListWorkGroups
$result = $client->listWorkGroups
([/* ... */]); $promise = $client->listWorkGroupsAsync
([/* ... */]);
Lists available workgroups for the account.
Parameter Syntax
$result = $client->listWorkGroups([ 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The maximum number of workgroups to return in this request.
- NextToken
-
- Type: 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.
Result Syntax
[ 'NextToken' => '<string>', 'WorkGroups' => [ [ 'CreationTime' => <DateTime>, 'Description' => '<string>', 'Name' => '<string>', 'State' => 'ENABLED|DISABLED', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: 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. - WorkGroups
-
- Type: Array of WorkGroupSummary structures
The list of workgroups, including their names, descriptions, creation times, and states.
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
StartQueryExecution
$result = $client->startQueryExecution
([/* ... */]); $promise = $client->startQueryExecutionAsync
([/* ... */]);
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 AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->startQueryExecution([ 'ClientRequestToken' => '<string>', 'QueryExecutionContext' => [ 'Catalog' => '<string>', 'Database' => '<string>', ], 'QueryString' => '<string>', // REQUIRED 'ResultConfiguration' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', // REQUIRED 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', ], 'WorkGroup' => '<string>', ]);
Parameter Details
Members
- ClientRequestToken
-
- Type: 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. If a parameter has changed, for example, theQueryString
, an error is returned.This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.
- QueryExecutionContext
-
- Type: QueryExecutionContext structure
The database within which the query executes.
- QueryString
-
- Required: Yes
- Type: string
The SQL query statements to be executed.
- ResultConfiguration
-
- Type: ResultConfiguration structure
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.
- WorkGroup
-
- Type: string
The name of the workgroup in which the query is being started.
Result Syntax
[ 'QueryExecutionId' => '<string>', ]
Result Details
Members
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
Indicates that the request was throttled.
StopQueryExecution
$result = $client->stopQueryExecution
([/* ... */]); $promise = $client->stopQueryExecutionAsync
([/* ... */]);
Stops a query execution. Requires you to have access to the workgroup in which the query ran.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
Parameter Syntax
$result = $client->stopQueryExecution([ 'QueryExecutionId' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
TagResource
$result = $client->tagResource
([/* ... */]); $promise = $client->tagResourceAsync
([/* ... */]);
Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. 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 or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs 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.
Parameter Syntax
$result = $client->tagResource([ 'ResourceARN' => '<string>', // REQUIRED 'Tags' => [ // REQUIRED [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ]);
Parameter Details
Members
- ResourceARN
-
- Required: Yes
- Type: string
Specifies the ARN of the Athena resource (workgroup or data catalog) to which tags are to be added.
- Tags
-
- Required: Yes
- Type: Array of Tag structures
A collection of one or more tags, separated by commas, to be added to an Athena workgroup or data catalog resource.
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
A resource, such as a workgroup, was not found.
UntagResource
$result = $client->untagResource
([/* ... */]); $promise = $client->untagResourceAsync
([/* ... */]);
Removes one or more tags from a data catalog or workgroup resource.
Parameter Syntax
$result = $client->untagResource([ 'ResourceARN' => '<string>', // REQUIRED 'TagKeys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
A resource, such as a workgroup, was not found.
UpdateDataCatalog
$result = $client->updateDataCatalog
([/* ... */]); $promise = $client->updateDataCatalogAsync
([/* ... */]);
Updates the data catalog that has the specified name.
Parameter Syntax
$result = $client->updateDataCatalog([ 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'Parameters' => ['<string>', ...], 'Type' => 'LAMBDA|GLUE|HIVE', // REQUIRED ]);
Parameter Details
Members
- Description
-
- Type: string
New or modified text that describes the data catalog.
- Name
-
- Required: Yes
- Type: string
The name of the data catalog to update. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
- Parameters
-
- Type: Associative array of custom strings keys (KeyString) to strings
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. Themetadata-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 has no parameters.
- Type
-
- Required: Yes
- Type: string
Specifies the type of data catalog to update. Specify
LAMBDA
for a federated catalog,GLUE
for AWS Glue Catalog, orHIVE
for an external hive metastore.
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
UpdateWorkGroup
$result = $client->updateWorkGroup
([/* ... */]); $promise = $client->updateWorkGroupAsync
([/* ... */]);
Updates the workgroup with the specified name. The workgroup's name cannot be changed.
Parameter Syntax
$result = $client->updateWorkGroup([ 'ConfigurationUpdates' => [ 'BytesScannedCutoffPerQuery' => <integer>, 'EnforceWorkGroupConfiguration' => true || false, 'PublishCloudWatchMetricsEnabled' => true || false, 'RemoveBytesScannedCutoffPerQuery' => true || false, 'RequesterPaysEnabled' => true || false, 'ResultConfigurationUpdates' => [ 'EncryptionConfiguration' => [ 'EncryptionOption' => 'SSE_S3|SSE_KMS|CSE_KMS', // REQUIRED 'KmsKey' => '<string>', ], 'OutputLocation' => '<string>', 'RemoveEncryptionConfiguration' => true || false, 'RemoveOutputLocation' => true || false, ], ], 'Description' => '<string>', 'State' => 'ENABLED|DISABLED', 'WorkGroup' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ConfigurationUpdates
-
- Type: WorkGroupConfigurationUpdates structure
The workgroup configuration that will be updated for the given workgroup.
- Description
-
- Type: string
The workgroup description.
- State
-
- Type: string
The workgroup state that will be updated for the given workgroup.
- WorkGroup
-
- Required: Yes
- Type: string
The specified workgroup that will be updated.
Result Syntax
[]
Result Details
Errors
-
Indicates a platform issue, which may be due to a transient condition or outage.
-
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
Shapes
Column
Description
Contains metadata for a column in a table.
Members
ColumnInfo
Description
Information about the columns in a query execution result.
Members
- CaseSensitive
-
- Type: boolean
Indicates whether values in the column are case-sensitive.
- CatalogName
-
- Type: string
The catalog to which the query results belong.
- Label
-
- Type: string
A column label.
- Name
-
- Required: Yes
- Type: string
The name of the column.
- Nullable
-
- Type: string
Indicates the column's nullable status.
- Precision
-
- Type: int
For
DECIMAL
data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits. - Scale
-
- Type: int
For
DECIMAL
data types, specifies the total number of digits in the fractional part of the value. Defaults to 0. - SchemaName
-
- Type: string
The schema name (database name) to which the query results belong.
- TableName
-
- Type: string
The table name for the query results.
- Type
-
- Required: Yes
- Type: string
The data type of the column.
DataCatalog
Description
Contains information about a data catalog in an AWS account.
Members
- Description
-
- Type: string
An optional description of the data catalog.
- Name
-
- Required: Yes
- Type: string
The name of the data catalog. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
- Parameters
-
- Type: Associative array of custom strings keys (KeyString) to strings
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. Themetadata-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 has no parameters.
- Type
-
- Required: Yes
- Type: string
The type of data catalog:
LAMBDA
for a federated catalog,GLUE
for AWS Glue Catalog, orHIVE
for an external hive metastore.
DataCatalogSummary
Description
The summary information for the data catalog, which includes its name and type.
Members
Database
Description
Contains metadata information for a database in a data catalog.
Members
Datum
Description
A piece of data (a field in the table).
Members
EncryptionConfiguration
Description
If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS
or CSE-KMS
) and key information.
Members
- EncryptionOption
-
- Required: Yes
- Type: 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
-
- Type: string
For
SSE-KMS
andCSE-KMS
, this is the KMS key ARN or ID.
InternalServerException
Description
Indicates a platform issue, which may be due to a transient condition or outage.
Members
InvalidRequestException
Description
Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
Members
MetadataException
Description
An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (InvalidRequestException
) or from the Athena platform (InternalServerException
). For example, if a user-created Lambda function is missing permissions, the Lambda 4XX
exception is returned in a MetadataException
.
Members
NamedQuery
Description
A query, where QueryString
is the list of SQL query statements that comprise the query.
Members
- Database
-
- Required: Yes
- Type: string
The database to which the query belongs.
- Description
-
- Type: string
The query description.
- Name
-
- Required: Yes
- Type: string
The query name.
- NamedQueryId
-
- Type: string
The unique identifier of the query.
- QueryString
-
- Required: Yes
- Type: string
The SQL query statements that comprise the query.
- WorkGroup
-
- Type: string
The name of the workgroup that contains the named query.
QueryExecution
Description
Information about a single instance of a query execution.
Members
- Query
-
- Type: string
The SQL query statements which the query execution ran.
- QueryExecutionContext
-
- Type: QueryExecutionContext structure
The database in which the query execution occurred.
- QueryExecutionId
-
- Type: string
The unique identifier for each query execution.
- ResultConfiguration
-
- Type: ResultConfiguration structure
The location in Amazon S3 where query results were 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.
- StatementType
-
- Type: string
The type of query statement that was run.
DDL
indicates DDL query statements.DML
indicates DML (Data Manipulation Language) query statements, such asCREATE TABLE AS SELECT
.UTILITY
indicates query statements other than DDL and DML, such asSHOW CREATE TABLE
, orDESCRIBE <table>
. - Statistics
-
- Type: QueryExecutionStatistics structure
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.
- Status
-
- Type: QueryExecutionStatus structure
The completion date, current state, submission time, and state change reason (if applicable) for the query execution.
- WorkGroup
-
- Type: string
The name of the workgroup in which the query ran.
QueryExecutionContext
Description
The database and data catalog context in which the query execution occurs.
Members
QueryExecutionStatistics
Description
The amount of data scanned during the query execution and the amount of time that it took to execute, and the type of statement that was run.
Members
- DataManifestLocation
-
- Type: 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.
- DataScannedInBytes
-
- Type: long (int|float)
The number of bytes in the data that was queried.
- EngineExecutionTimeInMillis
-
- Type: long (int|float)
The number of milliseconds that the query took to execute.
- QueryPlanningTimeInMillis
-
- Type: long (int|float)
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.
- QueryQueueTimeInMillis
-
- Type: long (int|float)
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.
- ServiceProcessingTimeInMillis
-
- Type: long (int|float)
The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.
- TotalExecutionTimeInMillis
-
- Type: long (int|float)
The number of milliseconds that Athena took to run the query.
QueryExecutionStatus
Description
The completion date, current state, submission time, and state change reason (if applicable) for the query execution.
Members
- CompletionDateTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date and time that the query completed.
- State
-
- Type: 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.Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from
RUNNING
orFAILED
toQUEUED
. - StateChangeReason
-
- Type: string
Further detail about the status of the query.
- SubmissionDateTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date and time that the query was submitted.
ResourceNotFoundException
Description
A resource, such as a workgroup, was not found.
Members
ResultConfiguration
Description
The location in Amazon S3 where query 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 workgroup settings.
Members
- EncryptionConfiguration
-
- Type: EncryptionConfiguration structure
If query results are encrypted in Amazon S3, indicates the encryption option used (for example,
SSE-KMS
orCSE-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. - OutputLocation
-
- Type: string
The location in Amazon S3 where your query 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. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
ResultConfigurationUpdates
Description
The information about the updates in the query results, such as output location and encryption configuration for the query results.
Members
- EncryptionConfiguration
-
- Type: EncryptionConfiguration structure
The encryption configuration for the query results.
- OutputLocation
-
- Type: string
The location in Amazon S3 where your query results are stored, such as
s3://path/to/query/bucket/
. For more information, see Query Results 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. - RemoveEncryptionConfiguration
-
- Type: 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.
- RemoveOutputLocation
-
- Type: 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.
ResultSet
Description
The metadata and rows that comprise a query result set. The metadata describes the column structure and data types. To return a ResultSet
object, use GetQueryResults.
Members
- ResultSetMetadata
-
- Type: ResultSetMetadata structure
The metadata that describes the column structure and data types of a table of query results.
- Rows
-
- Type: Array of Row structures
The rows in the table.
ResultSetMetadata
Description
The metadata that describes the column structure and data types of a table of query results. To return a ResultSetMetadata
object, use GetQueryResults.
Members
- ColumnInfo
-
- Type: Array of ColumnInfo structures
Information about the columns returned in a query result metadata.
Row
Description
The rows that comprise a query result table.
Members
- Data
-
- Type: Array of Datum structures
The data that populates a row in a query result table.
TableMetadata
Description
Contains metadata for a table.
Members
- Columns
-
- Type: Array of Column structures
A list of the columns in the table.
- CreateTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The time that the table was created.
- LastAccessTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The last time the table was accessed.
- Name
-
- Required: Yes
- Type: string
The name of the table.
- Parameters
-
- Type: Associative array of custom strings keys (KeyString) to strings
A set of custom key/value pairs for table properties.
- PartitionKeys
-
- Type: Array of Column structures
A list of the partition keys in the table.
- TableType
-
- Type: string
The type of table. In Athena, only
EXTERNAL_TABLE
is supported.
Tag
Description
A label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. 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 or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs 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.
Members
- Key
-
- Type: 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
-
- Type: 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.
TooManyRequestsException
Description
Indicates that the request was throttled.
Members
UnprocessedNamedQueryId
Description
Information about a named query ID that could not be processed.
Members
- ErrorCode
-
- Type: string
The error code returned when the processing request for the named query failed, if applicable.
- ErrorMessage
-
- Type: string
The error message returned when the processing request for the named query failed, if applicable.
- NamedQueryId
-
- Type: string
The unique identifier of the named query.
UnprocessedQueryExecutionId
Description
Describes a query execution that failed to process.
Members
WorkGroup
Description
A workgroup, which contains a name, description, creation time, state, and other configuration, listed under WorkGroup$Configuration. Each workgroup enables you to isolate queries for you or your group of users from other queries in the same account, to configure the query results location and the encryption configuration (known as workgroup settings), to enable sending query metrics to Amazon CloudWatch, and to establish per-query data usage control limits for all queries in a workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
Members
- Configuration
-
- Type: WorkGroupConfiguration structure
The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption configuration, if any, used for query 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.
- CreationTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date and time the workgroup was created.
- Description
-
- Type: string
The workgroup description.
- Name
-
- Required: Yes
- Type: string
The workgroup name.
- State
-
- Type: string
The state of the workgroup: ENABLED or DISABLED.
WorkGroupConfiguration
Description
The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption option, if any, used for query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup and whether workgroup settings override query 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.
Members
- BytesScannedCutoffPerQuery
-
- Type: long (int|float)
The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.
- EnforceWorkGroupConfiguration
-
- Type: 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
-
- Type: boolean
Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.
- RequesterPaysEnabled
-
- Type: boolean
If set to
true
, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set tofalse
, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default isfalse
. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide. - ResultConfiguration
-
- Type: ResultConfiguration structure
The configuration for the workgroup, which includes the location in Amazon S3 where query results are stored and the encryption option, if any, used for query 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. For more information, see Query Results.
WorkGroupConfigurationUpdates
Description
The configuration information that will be updated for this workgroup, which includes the location in Amazon S3 where query results are stored, the encryption option, if any, used for query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, whether the workgroup settings override the client-side settings, and the data usage limit for the amount of bytes scanned per query, if it is specified.
Members
- BytesScannedCutoffPerQuery
-
- Type: long (int|float)
The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.
- EnforceWorkGroupConfiguration
-
- Type: 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
-
- Type: boolean
Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.
- RemoveBytesScannedCutoffPerQuery
-
- Type: boolean
Indicates that the data usage control limit per query is removed. WorkGroupConfiguration$BytesScannedCutoffPerQuery
- RequesterPaysEnabled
-
- Type: boolean
If set to
true
, allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set tofalse
, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default isfalse
. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide. - ResultConfigurationUpdates
-
- Type: ResultConfigurationUpdates structure
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.
WorkGroupSummary
Description
The summary information for the workgroup, which includes its name, state, description, and the date and time it was created.