AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing 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.

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

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.Athena.AmazonAthenaClient

Namespace: Amazon.Athena
Assembly: AWSSDK.Athena.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonAthenaClient : AmazonServiceClient
         IAmazonAthena, IAmazonService, IDisposable

The AmazonAthenaClient type exposes the following members

Constructors

NameDescription
Public Method AmazonAthenaClient()

Constructs AmazonAthenaClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonAthenaClient(RegionEndpoint)

Constructs AmazonAthenaClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonAthenaClient(AmazonAthenaConfig)

Constructs AmazonAthenaClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonAthenaClient(AWSCredentials)

Constructs AmazonAthenaClient with AWS Credentials

Public Method AmazonAthenaClient(AWSCredentials, RegionEndpoint)

Constructs AmazonAthenaClient with AWS Credentials

Public Method AmazonAthenaClient(AWSCredentials, AmazonAthenaConfig)

Constructs AmazonAthenaClient with AWS Credentials and an AmazonAthenaClient Configuration object.

Public Method AmazonAthenaClient(string, string)

Constructs AmazonAthenaClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAthenaClient(string, string, RegionEndpoint)

Constructs AmazonAthenaClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAthenaClient(string, string, AmazonAthenaConfig)

Constructs AmazonAthenaClient with AWS Access Key ID, AWS Secret Key and an AmazonAthenaClient Configuration object.

Public Method AmazonAthenaClient(string, string, string)

Constructs AmazonAthenaClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAthenaClient(string, string, string, RegionEndpoint)

Constructs AmazonAthenaClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAthenaClient(string, string, string, AmazonAthenaConfig)

Constructs AmazonAthenaClient with AWS Access Key ID, AWS Secret Key and an AmazonAthenaClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method BatchGetNamedQuery(BatchGetNamedQueryRequest)

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.

Public Method BatchGetNamedQueryAsync(BatchGetNamedQueryRequest, CancellationToken)

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.

Public Method BatchGetQueryExecution(BatchGetQueryExecutionRequest)

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.

Public Method BatchGetQueryExecutionAsync(BatchGetQueryExecutionRequest, CancellationToken)

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.

Public Method CreateNamedQuery(CreateNamedQueryRequest)

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.

Public Method CreateNamedQueryAsync(CreateNamedQueryRequest, CancellationToken)

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.

Public Method CreateWorkGroup(CreateWorkGroupRequest)

Creates a workgroup with the specified name.

Public Method CreateWorkGroupAsync(CreateWorkGroupRequest, CancellationToken)

Creates a workgroup with the specified name.

Public Method DeleteNamedQuery(DeleteNamedQueryRequest)

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.

Public Method DeleteNamedQueryAsync(DeleteNamedQueryRequest, CancellationToken)

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.

Public Method DeleteWorkGroup(DeleteWorkGroupRequest)

Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.

Public Method DeleteWorkGroupAsync(DeleteWorkGroupRequest, CancellationToken)

Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetNamedQuery(GetNamedQueryRequest)

Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.

Public Method GetNamedQueryAsync(GetNamedQueryRequest, CancellationToken)

Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.

Public Method GetQueryExecution(GetQueryExecutionRequest)

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.

Public Method GetQueryExecutionAsync(GetQueryExecutionRequest, CancellationToken)

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.

Public Method GetQueryResults(GetQueryResultsRequest)

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.

Public Method GetQueryResultsAsync(GetQueryResultsRequest, CancellationToken)

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.

Public Method GetWorkGroup(GetWorkGroupRequest)

Returns information about the workgroup with the specified name.

Public Method GetWorkGroupAsync(GetWorkGroupRequest, CancellationToken)

Returns information about the workgroup with the specified name.

Public Method ListNamedQueries(ListNamedQueriesRequest)

Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the 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.

Public Method ListNamedQueriesAsync(ListNamedQueriesRequest, CancellationToken)

Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the 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.

Public Method ListQueryExecutions(ListQueryExecutionsRequest)

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.

Public Method ListQueryExecutionsAsync(ListQueryExecutionsRequest, CancellationToken)

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.

Public Method ListTagsForResource(ListTagsForResourceRequest)

Lists the tags associated with this workgroup.

Public Method ListTagsForResourceAsync(ListTagsForResourceRequest, CancellationToken)

Lists the tags associated with this workgroup.

Public Method ListWorkGroups(ListWorkGroupsRequest)

Lists available workgroups for the account.

Public Method ListWorkGroupsAsync(ListWorkGroupsRequest, CancellationToken)

Lists available workgroups for the account.

Public Method StartQueryExecution(StartQueryExecutionRequest)

Runs the SQL query statements contained in the Query. 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.

Public Method StartQueryExecutionAsync(StartQueryExecutionRequest, CancellationToken)

Runs the SQL query statements contained in the Query. 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.

Public Method StopQueryExecution(StopQueryExecutionRequest)

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.

Public Method StopQueryExecutionAsync(StopQueryExecutionRequest, CancellationToken)

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.

Public Method TagResource(TagResourceRequest)

Adds one or more tags to the resource, such as a workgroup. A tag is a label that you assign to an AWS Athena resource (a workgroup). Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize resources (workgroups) in Athena, for example, by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups in your account. For best practices, see AWS Tagging Strategies. The key length is from 1 (minimum) to 128 (maximum) Unicode characters in UTF-8. The tag value length is from 0 (minimum) to 256 (maximum) Unicode characters in UTF-8. You 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, separate them by commas.

Public Method TagResourceAsync(TagResourceRequest, CancellationToken)

Adds one or more tags to the resource, such as a workgroup. A tag is a label that you assign to an AWS Athena resource (a workgroup). Each tag consists of a key and an optional value, both of which you define. Tags enable you to categorize resources (workgroups) in Athena, for example, by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups in your account. For best practices, see AWS Tagging Strategies. The key length is from 1 (minimum) to 128 (maximum) Unicode characters in UTF-8. The tag value length is from 0 (minimum) to 256 (maximum) Unicode characters in UTF-8. You 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, separate them by commas.

Public Method UntagResource(UntagResourceRequest)

Removes one or more tags from the workgroup resource. Takes as an input a list of TagKey Strings separated by commas, and removes their tags at the same time.

Public Method UntagResourceAsync(UntagResourceRequest, CancellationToken)

Removes one or more tags from the workgroup resource. Takes as an input a list of TagKey Strings separated by commas, and removes their tags at the same time.

Public Method UpdateWorkGroup(UpdateWorkGroupRequest)

Updates the workgroup with the specified name. The workgroup's name cannot be changed.

Public Method UpdateWorkGroupAsync(UpdateWorkGroupRequest, CancellationToken)

Updates the workgroup with the specified name. The workgroup's name cannot be changed.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms