Class: AWS.Athena

Inherits:
AWS.Service show all
Identifier:
athena
API Version:
2017-05-18
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

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.

Sending a Request Using Athena

var athena = new AWS.Athena();
athena.batchGetNamedQuery(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the Athena object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var athena = new AWS.Athena({apiVersion: '2017-05-18'});

You can also set the API version globally in AWS.config.apiVersions using the athena service identifier:

AWS.config.apiVersions = {
  athena: '2017-05-18',
  // other service API versions
};

var athena = new AWS.Athena();

Version:

  • 2017-05-18

Constructor Summary

Property Summary

Properties inherited from AWS.Service

apiVersions

Method Summary

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.Athena(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a Athena object

var athena = new AWS.Athena({apiVersion: '2017-05-18'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.Athena.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.Athena.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.Athena.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchGetNamedQuery(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the batchGetNamedQuery operation

var params = {
  NamedQueryIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
athena.batchGetNamedQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NamedQueryIds — (Array<String>)

      An array of query IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NamedQueries — (Array<map>)

        Information about the named query IDs submitted.

        • Namerequired — (String)

          The query name.

        • Description — (String)

          The query description.

        • Databaserequired — (String)

          The database to which the query belongs.

        • QueryStringrequired — (String)

          The SQL query statements that comprise the query.

        • NamedQueryId — (String)

          The unique identifier of the query.

        • WorkGroup — (String)

          The name of the workgroup that contains the named query.

      • UnprocessedNamedQueryIds — (Array<map>)

        Information about provided query IDs.

        • NamedQueryId — (String)

          The unique identifier of the named query.

        • ErrorCode — (String)

          The error code returned when the processing request for the named query failed, if applicable.

        • ErrorMessage — (String)

          The error message returned when the processing request for the named query failed, if applicable.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchGetQueryExecution(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the batchGetQueryExecution operation

var params = {
  QueryExecutionIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
athena.batchGetQueryExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • QueryExecutionIds — (Array<String>)

      An array of query execution IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • QueryExecutions — (Array<map>)

        Information about a query execution.

        • QueryExecutionId — (String)

          The unique identifier for each query execution.

        • Query — (String)

          The SQL query statements which the query execution ran.

        • StatementType — (String)

          The type of query statement that was run. DDL indicates DDL query statements. DML indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT. UTILITY indicates query statements other than DDL and DML, such as SHOW CREATE TABLE, or DESCRIBE <table>.

          Possible values include:
          • "DDL"
          • "DML"
          • "UTILITY"
        • ResultConfiguration — (map)

          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.

          • OutputLocation — (String)

            The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. 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.

          • EncryptionConfiguration — (map)

            If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.

            • EncryptionOptionrequired — (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.

              Possible values include:
              • "SSE_S3"
              • "SSE_KMS"
              • "CSE_KMS"
            • KmsKey — (String)

              For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

        • QueryExecutionContext — (map)

          The database in which the query execution occurred.

          • Database — (String)

            The name of the database.

        • Status — (map)

          The completion date, current state, submission time, and state change reason (if applicable) for the query execution.

          • State — (String)

            The state of query execution. QUEUED state is listed but is not used by Athena and is reserved for future use. RUNNING indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. 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.

            Possible values include:
            • "QUEUED"
            • "RUNNING"
            • "SUCCEEDED"
            • "FAILED"
            • "CANCELLED"
          • StateChangeReason — (String)

            Further detail about the status of the query.

          • SubmissionDateTime — (Date)

            The date and time that the query was submitted.

          • CompletionDateTime — (Date)

            The date and time that the query completed.

        • Statistics — (map)

          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.

          • EngineExecutionTimeInMillis — (Integer)

            The number of milliseconds that the query took to execute.

          • DataScannedInBytes — (Integer)

            The number of bytes in the data that was queried.

        • WorkGroup — (String)

          The name of the workgroup in which the query ran.

      • UnprocessedQueryExecutionIds — (Array<map>)

        Information about the query executions that failed to run.

        • QueryExecutionId — (String)

          The unique identifier of the query execution.

        • ErrorCode — (String)

          The error code returned when the query execution failed to process, if applicable.

        • ErrorMessage — (String)

          The error message returned when the query execution failed to process, if applicable.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createNamedQuery(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the createNamedQuery operation

var params = {
  Database: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE', /* required */
  QueryString: 'STRING_VALUE', /* required */
  ClientRequestToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  WorkGroup: 'STRING_VALUE'
};
athena.createNamedQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The query name.

    • Description — (String)

      The query description.

    • Database — (String)

      The database to which the query belongs.

    • QueryString — (String)

      The contents of the query with all query statements.

    • ClientRequestToken — (String)

      A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another CreateNamedQuery request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the QueryString, an error is returned.

      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.

      If a token is not provided, the SDK will use a version 4 UUID.
    • WorkGroup — (String)

      The name of the workgroup in which the named query is being created.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NamedQueryId — (String)

        The unique ID of the query.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createWorkGroup(params = {}, callback) ⇒ AWS.Request

Creates a workgroup with the specified name.

Service Reference:

Examples:

Calling the createWorkGroup operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Configuration: {
    BytesScannedCutoffPerQuery: 'NUMBER_VALUE',
    EnforceWorkGroupConfiguration: true || false,
    PublishCloudWatchMetricsEnabled: true || false,
    ResultConfiguration: {
      EncryptionConfiguration: {
        EncryptionOption: SSE_S3 | SSE_KMS | CSE_KMS, /* required */
        KmsKey: 'STRING_VALUE'
      },
      OutputLocation: 'STRING_VALUE'
    }
  },
  Description: 'STRING_VALUE',
  Tags: [
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
athena.createWorkGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The workgroup name.

    • Configuration — (map)

      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.

      • ResultConfiguration — (map)

        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.

        • OutputLocation — (String)

          The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. 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.

        • EncryptionConfiguration — (map)

          If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.

          • EncryptionOptionrequired — (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.

            Possible values include:
            • "SSE_S3"
            • "SSE_KMS"
            • "CSE_KMS"
          • KmsKey — (String)

            For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

      • EnforceWorkGroupConfiguration — (Boolean)

        If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings.

      • PublishCloudWatchMetricsEnabled — (Boolean)

        Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.

      • BytesScannedCutoffPerQuery — (Integer)

        The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.

    • Description — (String)

      The workgroup description.

    • Tags — (Array<map>)

      One or more tags, separated by commas, that you want to attach to the workgroup as you create it.

      • Key — (String)

        A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource.

      • Value — (String)

        A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteNamedQuery(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the deleteNamedQuery operation

var params = {
  NamedQueryId: 'STRING_VALUE' /* required */
};
athena.deleteNamedQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NamedQueryId — (String)

      The unique ID of the query to delete.

      If a token is not provided, the SDK will use a version 4 UUID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteWorkGroup(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the deleteWorkGroup operation

var params = {
  WorkGroup: 'STRING_VALUE', /* required */
  RecursiveDeleteOption: true || false
};
athena.deleteWorkGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • WorkGroup — (String)

      The unique name of the workgroup to delete.

    • RecursiveDeleteOption — (Boolean)

      The option to delete the workgroup and its contents even if the workgroup contains any named queries.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getNamedQuery(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the getNamedQuery operation

var params = {
  NamedQueryId: 'STRING_VALUE' /* required */
};
athena.getNamedQuery(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NamedQueryId — (String)

      The unique ID of the query. Use ListNamedQueries to get query IDs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NamedQuery — (map)

        Information about the query.

        • Namerequired — (String)

          The query name.

        • Description — (String)

          The query description.

        • Databaserequired — (String)

          The database to which the query belongs.

        • QueryStringrequired — (String)

          The SQL query statements that comprise the query.

        • NamedQueryId — (String)

          The unique identifier of the query.

        • WorkGroup — (String)

          The name of the workgroup that contains the named query.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getQueryExecution(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the getQueryExecution operation

var params = {
  QueryExecutionId: 'STRING_VALUE' /* required */
};
athena.getQueryExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • QueryExecutionId — (String)

      The unique ID of the query execution.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • QueryExecution — (map)

        Information about the query execution.

        • QueryExecutionId — (String)

          The unique identifier for each query execution.

        • Query — (String)

          The SQL query statements which the query execution ran.

        • StatementType — (String)

          The type of query statement that was run. DDL indicates DDL query statements. DML indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT. UTILITY indicates query statements other than DDL and DML, such as SHOW CREATE TABLE, or DESCRIBE <table>.

          Possible values include:
          • "DDL"
          • "DML"
          • "UTILITY"
        • ResultConfiguration — (map)

          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.

          • OutputLocation — (String)

            The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. 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.

          • EncryptionConfiguration — (map)

            If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.

            • EncryptionOptionrequired — (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.

              Possible values include:
              • "SSE_S3"
              • "SSE_KMS"
              • "CSE_KMS"
            • KmsKey — (String)

              For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

        • QueryExecutionContext — (map)

          The database in which the query execution occurred.

          • Database — (String)

            The name of the database.

        • Status — (map)

          The completion date, current state, submission time, and state change reason (if applicable) for the query execution.

          • State — (String)

            The state of query execution. QUEUED state is listed but is not used by Athena and is reserved for future use. RUNNING indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. 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.

            Possible values include:
            • "QUEUED"
            • "RUNNING"
            • "SUCCEEDED"
            • "FAILED"
            • "CANCELLED"
          • StateChangeReason — (String)

            Further detail about the status of the query.

          • SubmissionDateTime — (Date)

            The date and time that the query was submitted.

          • CompletionDateTime — (Date)

            The date and time that the query completed.

        • Statistics — (map)

          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.

          • EngineExecutionTimeInMillis — (Integer)

            The number of milliseconds that the query took to execute.

          • DataScannedInBytes — (Integer)

            The number of bytes in the data that was queried.

        • WorkGroup — (String)

          The name of the workgroup in which the query ran.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getQueryResults(params = {}, callback) ⇒ AWS.Request

Returns the results of a single query execution specified by QueryExecutionId if you have access to the workgroup in which the query ran. This request does not execute the query but returns results. Use StartQueryExecution to run a query.

Service Reference:

Examples:

Calling the getQueryResults operation

var params = {
  QueryExecutionId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.getQueryResults(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • QueryExecutionId — (String)

      The unique ID of the query execution.

    • NextToken — (String)

      The token that specifies where to start pagination if a previous request was truncated.

    • MaxResults — (Integer)

      The maximum number of results (rows) to return in this request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • UpdateCount — (Integer)

        The number of rows inserted with a CREATE TABLE AS SELECT statement.

      • ResultSet — (map)

        The results of the query execution.

        • Rows — (Array<map>)

          The rows in the table.

          • Data — (Array<map>)

            The data that populates a row in a query result table.

            • VarCharValue — (String)

              The value of the datum.

        • ResultSetMetadata — (map)

          The metadata that describes the column structure and data types of a table of query results.

          • ColumnInfo — (Array<map>)

            Information about the columns returned in a query result metadata.

            • CatalogName — (String)

              The catalog to which the query results belong.

            • SchemaName — (String)

              The schema name (database name) to which the query results belong.

            • TableName — (String)

              The table name for the query results.

            • Namerequired — (String)

              The name of the column.

            • Label — (String)

              A column label.

            • Typerequired — (String)

              The data type of the column.

            • Precision — (Integer)

              For DECIMAL data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits.

            • Scale — (Integer)

              For DECIMAL data types, specifies the total number of digits in the fractional part of the value. Defaults to 0.

            • Nullable — (String)

              Indicates the column's nullable status.

              Possible values include:
              • "NOT_NULL"
              • "NULLABLE"
              • "UNKNOWN"
            • CaseSensitive — (Boolean)

              Indicates whether values in the column are case-sensitive.

      • NextToken — (String)

        A token to be used by the next request if this request is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getWorkGroup(params = {}, callback) ⇒ AWS.Request

Returns information about the workgroup with the specified name.

Service Reference:

Examples:

Calling the getWorkGroup operation

var params = {
  WorkGroup: 'STRING_VALUE' /* required */
};
athena.getWorkGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • WorkGroup — (String)

      The name of the workgroup.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • WorkGroup — (map)

        Information about the workgroup.

        • Namerequired — (String)

          The workgroup name.

        • State — (String)

          The state of the workgroup: ENABLED or DISABLED.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • Configuration — (map)

          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 limit for the amount of data scanned per query, if it is specified. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

          • ResultConfiguration — (map)

            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.

            • OutputLocation — (String)

              The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. 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.

            • EncryptionConfiguration — (map)

              If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.

              • EncryptionOptionrequired — (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.

                Possible values include:
                • "SSE_S3"
                • "SSE_KMS"
                • "CSE_KMS"
              • KmsKey — (String)

                For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

          • EnforceWorkGroupConfiguration — (Boolean)

            If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings.

          • PublishCloudWatchMetricsEnabled — (Boolean)

            Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.

          • BytesScannedCutoffPerQuery — (Integer)

            The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.

        • Description — (String)

          The workgroup description.

        • CreationTime — (Date)

          The date and time the workgroup was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listNamedQueries(params = {}, callback) ⇒ AWS.Request

Provides a list of available query IDs only for queries saved 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.

Service Reference:

Examples:

Calling the listNamedQueries operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  WorkGroup: 'STRING_VALUE'
};
athena.listNamedQueries(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      The token that specifies where to start pagination if a previous request was truncated.

    • MaxResults — (Integer)

      The maximum number of queries to return in this request.

    • WorkGroup — (String)

      The name of the workgroup from which the named queries are being returned.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NamedQueryIds — (Array<String>)

        The list of unique query IDs.

      • NextToken — (String)

        A token to be used by the next request if this request is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listQueryExecutions(params = {}, callback) ⇒ AWS.Request

Provides a list of available query execution IDs for the queries in the specified 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.

Service Reference:

Examples:

Calling the listQueryExecutions operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  WorkGroup: 'STRING_VALUE'
};
athena.listQueryExecutions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      The token that specifies where to start pagination if a previous request was truncated.

    • MaxResults — (Integer)

      The maximum number of query executions to return in this request.

    • WorkGroup — (String)

      The name of the workgroup from which queries are being returned.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • QueryExecutionIds — (Array<String>)

        The unique IDs of each query execution as an array of strings.

      • NextToken — (String)

        A token to be used by the next request if this request is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Lists the tags associated with this workgroup.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      Lists the tags for the workgroup resource with the specified ARN.

    • NextToken — (String)

      The token for the next set of results, or null if there are no additional results for this request, where the request lists the tags for the workgroup resource with the specified ARN.

    • MaxResults — (Integer)

      The maximum number of results to be returned per request that lists the tags for the workgroup resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (Array<map>)

        The list of tags associated with this workgroup.

        • Key — (String)

          A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource.

        • Value — (String)

          A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive.

      • NextToken — (String)

        A token to be used by the next request if this request is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listWorkGroups(params = {}, callback) ⇒ AWS.Request

Lists available workgroups for the account.

Service Reference:

Examples:

Calling the listWorkGroups operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listWorkGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

      A token to be used by the next request if this request is truncated.

    • MaxResults — (Integer)

      The maximum number of workgroups to return in this request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • WorkGroups — (Array<map>)

        The list of workgroups, including their names, descriptions, creation times, and states.

        • Name — (String)

          The name of the workgroup.

        • State — (String)

          The state of the workgroup.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • Description — (String)

          The workgroup description.

        • CreationTime — (Date)

          The workgroup creation date and time.

      • NextToken — (String)

        A token to be used by the next request if this request is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startQueryExecution(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the startQueryExecution operation

var params = {
  QueryString: 'STRING_VALUE', /* required */
  ClientRequestToken: 'STRING_VALUE',
  QueryExecutionContext: {
    Database: 'STRING_VALUE'
  },
  ResultConfiguration: {
    EncryptionConfiguration: {
      EncryptionOption: SSE_S3 | SSE_KMS | CSE_KMS, /* required */
      KmsKey: 'STRING_VALUE'
    },
    OutputLocation: 'STRING_VALUE'
  },
  WorkGroup: 'STRING_VALUE'
};
athena.startQueryExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • QueryString — (String)

      The SQL query statements to be executed.

    • ClientRequestToken — (String)

      A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another StartQueryExecution request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the QueryString, 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.

      If a token is not provided, the SDK will use a version 4 UUID.
    • QueryExecutionContext — (map)

      The database within which the query executes.

      • Database — (String)

        The name of the database.

    • ResultConfiguration — (map)

      Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

      • OutputLocation — (String)

        The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. 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.

      • EncryptionConfiguration — (map)

        If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration and Workgroup Settings Override Client-Side Settings.

        • EncryptionOptionrequired — (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.

          Possible values include:
          • "SSE_S3"
          • "SSE_KMS"
          • "CSE_KMS"
        • KmsKey — (String)

          For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

    • WorkGroup — (String)

      The name of the workgroup in which the query is being started.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • QueryExecutionId — (String)

        The unique ID of the query that ran as a result of this request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

stopQueryExecution(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the stopQueryExecution operation

var params = {
  QueryExecutionId: 'STRING_VALUE' /* required */
};
athena.stopQueryExecution(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • QueryExecutionId — (String)

      The unique ID of the query execution to stop.

      If a token is not provided, the SDK will use a version 4 UUID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
athena.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      Requests that one or more tags are added to the resource (such as a workgroup) for the specified ARN.

    • Tags — (Array<map>)

      One or more tags, separated by commas, to be added to the resource, such as a workgroup.

      • Key — (String)

        A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource.

      • Value — (String)

        A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
athena.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      Removes one or more tags from the workgroup resource for the specified ARN.

    • TagKeys — (Array<String>)

      Removes the tags associated with one or more tag keys from the workgroup resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateWorkGroup(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

Calling the updateWorkGroup operation

var params = {
  WorkGroup: 'STRING_VALUE', /* required */
  ConfigurationUpdates: {
    BytesScannedCutoffPerQuery: 'NUMBER_VALUE',
    EnforceWorkGroupConfiguration: true || false,
    PublishCloudWatchMetricsEnabled: true || false,
    RemoveBytesScannedCutoffPerQuery: true || false,
    ResultConfigurationUpdates: {
      EncryptionConfiguration: {
        EncryptionOption: SSE_S3 | SSE_KMS | CSE_KMS, /* required */
        KmsKey: 'STRING_VALUE'
      },
      OutputLocation: 'STRING_VALUE',
      RemoveEncryptionConfiguration: true || false,
      RemoveOutputLocation: true || false
    }
  },
  Description: 'STRING_VALUE',
  State: ENABLED | DISABLED
};
athena.updateWorkGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • WorkGroup — (String)

      The specified workgroup that will be updated.

    • Description — (String)

      The workgroup description.

    • ConfigurationUpdates — (map)

      The workgroup configuration that will be updated for the given workgroup.

      • EnforceWorkGroupConfiguration — (Boolean)

        If set to "true", the settings for the workgroup override client-side settings. If set to "false" client-side settings are used. For more information, see Workgroup Settings Override Client-Side Settings.

      • ResultConfigurationUpdates — (map)

        The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results.

        • OutputLocation — (String)

          The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files. If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The "workgroup settings override" is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

        • RemoveOutputLocation — (Boolean)

          If set to "true", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the OutputLocation in ResultConfigurationUpdates (the client-side setting), the OutputLocation in the workgroup's ResultConfiguration will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings.

        • EncryptionConfiguration — (map)

          The encryption configuration for the query results.

          • EncryptionOptionrequired — (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.

            Possible values include:
            • "SSE_S3"
            • "SSE_KMS"
            • "CSE_KMS"
          • KmsKey — (String)

            For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.

        • RemoveEncryptionConfiguration — (Boolean)

          If set to "true", indicates that the previously-specified encryption configuration (also known as the client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the EncryptionConfiguration in ResultConfigurationUpdates (the client-side setting), the EncryptionConfiguration in the workgroup's ResultConfiguration will be updated with the new value. For more information, see Workgroup Settings Override Client-Side Settings.

      • PublishCloudWatchMetricsEnabled — (Boolean)

        Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.

      • BytesScannedCutoffPerQuery — (Integer)

        The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.

      • RemoveBytesScannedCutoffPerQuery — (Boolean)

        Indicates that the data usage control limit per query is removed. WorkGroupConfiguration$BytesScannedCutoffPerQuery

    • State — (String)

      The workgroup state that will be updated for the given workgroup.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.