Athena class

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.

For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.

Constructors

Athena({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batchGetNamedQuery({required List<String> namedQueryIds}) Future<BatchGetNamedQueryOutput>
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.
batchGetQueryExecution({required List<String> queryExecutionIds}) Future<BatchGetQueryExecutionOutput>
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.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createDataCatalog({required String name, required DataCatalogType type, String? description, Map<String, String>? parameters, List<Tag>? tags}) Future<void>
Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same AWS account.
createNamedQuery({required String database, required String name, required String queryString, String? clientRequestToken, String? description, String? workGroup}) Future<CreateNamedQueryOutput>
Creates a named query in the specified workgroup. Requires that you have access to the workgroup.
createWorkGroup({required String name, WorkGroupConfiguration? configuration, String? description, List<Tag>? tags}) Future<void>
Creates a workgroup with the specified name.
deleteDataCatalog({required String name}) Future<void>
Deletes a data catalog.
deleteNamedQuery({String? namedQueryId}) Future<void>
Deletes the named query if you have access to the workgroup in which the query was saved.
deleteWorkGroup({required String workGroup, bool? recursiveDeleteOption}) Future<void>
Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.
getDatabase({required String catalogName, required String databaseName}) Future<GetDatabaseOutput>
Returns a database object for the specfied database and data catalog.
getDataCatalog({required String name}) Future<GetDataCatalogOutput>
Returns the specified data catalog.
getNamedQuery({required String namedQueryId}) Future<GetNamedQueryOutput>
Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.
getQueryExecution({required String queryExecutionId}) Future<GetQueryExecutionOutput>
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.
getQueryResults({required String queryExecutionId, int? maxResults, String? nextToken}) Future<GetQueryResultsOutput>
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.
getTableMetadata({required String catalogName, required String databaseName, required String tableName}) Future<GetTableMetadataOutput>
Returns table metadata for the specified catalog, database, and table.
getWorkGroup({required String workGroup}) Future<GetWorkGroupOutput>
Returns information about the workgroup with the specified name.
listDatabases({required String catalogName, int? maxResults, String? nextToken}) Future<ListDatabasesOutput>
Lists the databases in the specified data catalog.
listDataCatalogs({int? maxResults, String? nextToken}) Future<ListDataCatalogsOutput>
Lists the data catalogs in the current AWS account.
listNamedQueries({int? maxResults, String? nextToken, String? workGroup}) Future<ListNamedQueriesOutput>
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.
listQueryExecutions({int? maxResults, String? nextToken, String? workGroup}) Future<ListQueryExecutionsOutput>
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.
listTableMetadata({required String catalogName, required String databaseName, String? expression, int? maxResults, String? nextToken}) Future<ListTableMetadataOutput>
Lists the metadata for the tables in the specified data catalog database.
listTagsForResource({required String resourceARN, int? maxResults, String? nextToken}) Future<ListTagsForResourceOutput>
Lists the tags associated with an Athena workgroup or data catalog resource.
listWorkGroups({int? maxResults, String? nextToken}) Future<ListWorkGroupsOutput>
Lists available workgroups for the account.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startQueryExecution({required String queryString, String? clientRequestToken, QueryExecutionContext? queryExecutionContext, ResultConfiguration? resultConfiguration, String? workGroup}) Future<StartQueryExecutionOutput>
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.
stopQueryExecution({String? queryExecutionId}) Future<void>
Stops a query execution. Requires you to have access to the workgroup in which the query ran.
tagResource({required String resourceARN, required List<Tag> tags}) Future<void>
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.
toString() String
A string representation of this object.
inherited
untagResource({required String resourceARN, required List<String> tagKeys}) Future<void>
Removes one or more tags from a data catalog or workgroup resource.
updateDataCatalog({required String name, required DataCatalogType type, String? description, Map<String, String>? parameters}) Future<void>
Updates the data catalog that has the specified name.
updateWorkGroup({required String workGroup, WorkGroupConfigurationUpdates? configurationUpdates, String? description, WorkGroupState? state}) Future<void>
Updates the workgroup with the specified name. The workgroup's name cannot be changed.

Operators

operator ==(Object other) bool
The equality operator.
inherited