You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

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 Amazon Web Services 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 collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

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|AWS.Endpoint)

    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' or an Endpoint object.

  • 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.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets 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 error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • 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|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • 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.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

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/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

          • 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 used in the query execution. The database must exist in the catalog.

          • Catalog — (String)

            The name of the data catalog used in the query execution.

        • Status — (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 indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. RUNNING indicates that the query is in execution phase. SUCCEEDED indicates that the query completed without errors. FAILED indicates that the query experienced an error and did not complete processing. CANCELLED indicates that a user input interrupted query execution.

            Note: Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from RUNNING or FAILED to QUEUED.
            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)

          Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run.

          • EngineExecutionTimeInMillis — (Integer)

            The number of milliseconds that the query took to execute.

          • DataScannedInBytes — (Integer)

            The number of bytes in the data that was queried.

          • DataManifestLocation — (String)

            The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see Working with Query Results, Output Files, and Query History in the Amazon Athena User Guide.

          • TotalExecutionTimeInMillis — (Integer)

            The number of milliseconds that Athena took to run the query.

          • QueryQueueTimeInMillis — (Integer)

            The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.

          • QueryPlanningTimeInMillis — (Integer)

            The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.

          • ServiceProcessingTimeInMillis — (Integer)

            The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.

        • WorkGroup — (String)

          The name of the workgroup in which the query ran.

        • EngineVersion — (map)

          The engine version that executed the query.

          • SelectedEngineVersion — (String)

            The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

          • EffectiveEngineVersion — (String)

            Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

      • 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.

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

Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same Amazon Web Services account.

Service Reference:

Examples:

Calling the createDataCatalog operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Type: LAMBDA | GLUE | HIVE, /* required */
  Description: 'STRING_VALUE',
  Parameters: {
    '<KeyString>': 'STRING_VALUE',
    /* '<KeyString>': ... */
  },
  Tags: [
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
athena.createDataCatalog(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 name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.

    • Type — (String)

      The type of data catalog to create: LAMBDA for a federated catalog, HIVE for an external hive metastore, or GLUE for an Glue Data Catalog.

      Possible values include:
      • "LAMBDA"
      • "GLUE"
      • "HIVE"
    • Description — (String)

      A description of the data catalog to be created.

    • Parameters — (map<String>)

      Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type.

      • For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.

        metadata-function=lambda_arn, sdk-version=version_number

      • For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.

        • If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.

          metadata-function=lambda_arn, record-function=lambda_arn

        • If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.

          function=lambda_arn

      • The GLUE type takes a catalog ID parameter and is required. The catalog_id is the account ID of the Amazon Web Services account to which the Glue Data Catalog belongs.

        catalog-id=catalog_id

        • The GLUE data catalog type also applies to the default AwsDataCatalog that already exists in your account, of which you can have only one and cannot modify.

        • Queries that specify a Glue Data Catalog other than the default AwsDataCatalog must be run on Athena engine version 2.

        • In Regions where Athena engine version 2 is not available, creating new Glue data catalogs results in an INVALID_INPUT error.

    • Tags — (Array<map>)

      A list of comma separated tags to add to the data catalog that is created.

      • 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.

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 Amazon Web Services 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 Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.

      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.

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

Creates a prepared statement for use with SQL queries in Athena.

Service Reference:

Examples:

Calling the createPreparedStatement operation

var params = {
  QueryStatement: 'STRING_VALUE', /* required */
  StatementName: 'STRING_VALUE', /* required */
  WorkGroup: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE'
};
athena.createPreparedStatement(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: {})
    • StatementName — (String)

      The name of the prepared statement.

    • WorkGroup — (String)

      The name of the workgroup to which the prepared statement belongs.

    • QueryStatement — (String)

      The query string for the prepared statement.

    • Description — (String)

      The description of the prepared statement.

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.

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,
    EngineVersion: {
      EffectiveEngineVersion: 'STRING_VALUE',
      SelectedEngineVersion: 'STRING_VALUE'
    },
    PublishCloudWatchMetricsEnabled: true || false,
    RequesterPaysEnabled: 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. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using ResultConfiguration$OutputLocation. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results.

        • OutputLocation — (String)

          The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

        • 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.

      • RequesterPaysEnabled — (Boolean)

        If set to true, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.

      • EngineVersion — (map)

        The engine version that all queries running on the workgroup use. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.

        • SelectedEngineVersion — (String)

          The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

        • EffectiveEngineVersion — (String)

          Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

    • Description — (String)

      The workgroup description.

    • Tags — (Array<map>)

      A list of comma separated tags to add to the workgroup that is created.

      • 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.

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

Deletes a data catalog.

Service Reference:

Examples:

Calling the deleteDataCatalog operation

var params = {
  Name: 'STRING_VALUE' /* required */
};
athena.deleteDataCatalog(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 name of the data catalog to delete.

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 Amazon Web Services 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.

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

Deletes the prepared statement with the specified name from the specified workgroup.

Service Reference:

Examples:

Calling the deletePreparedStatement operation

var params = {
  StatementName: 'STRING_VALUE', /* required */
  WorkGroup: 'STRING_VALUE' /* required */
};
athena.deletePreparedStatement(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: {})
    • StatementName — (String)

      The name of the prepared statement to delete.

    • WorkGroup — (String)

      The workgroup to which the statement to be deleted belongs.

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 or query executions.

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.

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

Returns a database object for the specified database and data catalog.

Service Reference:

Examples:

Calling the getDatabase operation

var params = {
  CatalogName: 'STRING_VALUE', /* required */
  DatabaseName: 'STRING_VALUE' /* required */
};
athena.getDatabase(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: {})
    • CatalogName — (String)

      The name of the data catalog that contains the database to return.

    • DatabaseName — (String)

      The name of the database to return.

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:

      • Database — (map)

        The database returned.

        • Namerequired — (String)

          The name of the database.

        • Description — (String)

          An optional description of the database.

        • Parameters — (map<String>)

          A set of custom key/value pairs.

Returns:

  • (AWS.Request)

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

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

Returns the specified data catalog.

Service Reference:

Examples:

Calling the getDataCatalog operation

var params = {
  Name: 'STRING_VALUE' /* required */
};
athena.getDataCatalog(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 name of the data catalog to return.

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:

      • DataCatalog — (map)

        The data catalog returned.

        • Namerequired — (String)

          The name of the data catalog. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.

        • Description — (String)

          An optional description of the data catalog.

        • Typerequired — (String)

          The type of data catalog to create: LAMBDA for a federated catalog, HIVE for an external hive metastore, or GLUE for an Glue Data Catalog.

          Possible values include:
          • "LAMBDA"
          • "GLUE"
          • "HIVE"
        • Parameters — (map<String>)

          Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type.

          • For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.

            metadata-function=lambda_arn, sdk-version=version_number

          • For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.

            • If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.

              metadata-function=lambda_arn, record-function=lambda_arn

            • If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.

              function=lambda_arn

          • The GLUE type takes a catalog ID parameter and is required. The catalog_id is the account ID of the Amazon Web Services account to which the Glue catalog belongs.

            catalog-id=catalog_id

            • The GLUE data catalog type also applies to the default AwsDataCatalog that already exists in your account, of which you can have only one and cannot modify.

            • Queries that specify a Glue Data Catalog other than the default AwsDataCatalog must be run on Athena engine version 2.

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.

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

Retrieves the prepared statement with the specified name from the specified workgroup.

Service Reference:

Examples:

Calling the getPreparedStatement operation

var params = {
  StatementName: 'STRING_VALUE', /* required */
  WorkGroup: 'STRING_VALUE' /* required */
};
athena.getPreparedStatement(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: {})
    • StatementName — (String)

      The name of the prepared statement to retrieve.

    • WorkGroup — (String)

      The workgroup to which the statement to be retrieved belongs.

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:

      • PreparedStatement — (map)

        The name of the prepared statement that was retrieved.

        • StatementName — (String)

          The name of the prepared statement.

        • QueryStatement — (String)

          The query string for the prepared statement.

        • WorkGroupName — (String)

          The name of the workgroup to which the prepared statement belongs.

        • Description — (String)

          The description of the prepared statement.

        • LastModifiedTime — (Date)

          The last modified time of the prepared statement.

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/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

          • 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 used in the query execution. The database must exist in the catalog.

          • Catalog — (String)

            The name of the data catalog used in the query execution.

        • Status — (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 indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. RUNNING indicates that the query is in execution phase. SUCCEEDED indicates that the query completed without errors. FAILED indicates that the query experienced an error and did not complete processing. CANCELLED indicates that a user input interrupted query execution.

            Note: Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from RUNNING or FAILED to QUEUED.
            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)

          Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run.

          • EngineExecutionTimeInMillis — (Integer)

            The number of milliseconds that the query took to execute.

          • DataScannedInBytes — (Integer)

            The number of bytes in the data that was queried.

          • DataManifestLocation — (String)

            The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see Working with Query Results, Output Files, and Query History in the Amazon Athena User Guide.

          • TotalExecutionTimeInMillis — (Integer)

            The number of milliseconds that Athena took to run the query.

          • QueryQueueTimeInMillis — (Integer)

            The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.

          • QueryPlanningTimeInMillis — (Integer)

            The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.

          • ServiceProcessingTimeInMillis — (Integer)

            The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.

        • WorkGroup — (String)

          The name of the workgroup in which the query ran.

        • EngineVersion — (map)

          The engine version that executed the query.

          • SelectedEngineVersion — (String)

            The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

          • EffectiveEngineVersion — (String)

            Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

Returns:

  • (AWS.Request)

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

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

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.

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)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

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

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 generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Returns:

  • (AWS.Request)

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

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

Returns table metadata for the specified catalog, database, and table.

Service Reference:

Examples:

Calling the getTableMetadata operation

var params = {
  CatalogName: 'STRING_VALUE', /* required */
  DatabaseName: 'STRING_VALUE', /* required */
  TableName: 'STRING_VALUE' /* required */
};
athena.getTableMetadata(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: {})
    • CatalogName — (String)

      The name of the data catalog that contains the database and table metadata to return.

    • DatabaseName — (String)

      The name of the database that contains the table metadata to return.

    • TableName — (String)

      The name of the table for which metadata is 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:

      • TableMetadata — (map)

        An object that contains table metadata.

        • Namerequired — (String)

          The name of the table.

        • CreateTime — (Date)

          The time that the table was created.

        • LastAccessTime — (Date)

          The last time the table was accessed.

        • TableType — (String)

          The type of table. In Athena, only EXTERNAL_TABLE is supported.

        • Columns — (Array<map>)

          A list of the columns in the table.

          • Namerequired — (String)

            The name of the column.

          • Type — (String)

            The data type of the column.

          • Comment — (String)

            Optional information about the column.

        • PartitionKeys — (Array<map>)

          A list of the partition keys in the table.

          • Namerequired — (String)

            The name of the column.

          • Type — (String)

            The data type of the column.

          • Comment — (String)

            Optional information about the column.

        • Parameters — (map<String>)

          A set of custom key/value pairs for table properties.

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

          • ResultConfiguration — (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. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using ResultConfiguration$OutputLocation. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results.

            • OutputLocation — (String)

              The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

            • 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.

          • RequesterPaysEnabled — (Boolean)

            If set to true, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.

          • EngineVersion — (map)

            The engine version that all queries running on the workgroup use. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.

            • SelectedEngineVersion — (String)

              The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

            • EffectiveEngineVersion — (String)

              Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

        • 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.

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

Lists the databases in the specified data catalog.

Service Reference:

Examples:

Calling the listDatabases operation

var params = {
  CatalogName: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listDatabases(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: {})
    • CatalogName — (String)

      The name of the data catalog that contains the databases to return.

    • NextToken — (String)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      Specifies the maximum number of results to return.

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:

      • DatabaseList — (Array<map>)

        A list of databases from a data catalog.

        • Namerequired — (String)

          The name of the database.

        • Description — (String)

          An optional description of the database.

        • Parameters — (map<String>)

          A set of custom key/value pairs.

      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Returns:

  • (AWS.Request)

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

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

Lists the data catalogs in the current Amazon Web Services account.

Service Reference:

Examples:

Calling the listDataCatalogs operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listDataCatalogs(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 generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      Specifies the maximum number of data catalogs to return.

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:

      • DataCatalogsSummary — (Array<map>)

        A summary list of data catalogs.

        • CatalogName — (String)

          The name of the data catalog.

        • Type — (String)

          The data catalog type.

          Possible values include:
          • "LAMBDA"
          • "GLUE"
          • "HIVE"
      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Returns:

  • (AWS.Request)

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

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

Returns a list of engine versions that are available to choose from, including the Auto option.

Service Reference:

Examples:

Calling the listEngineVersions operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listEngineVersions(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 generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      The maximum number of engine versions to return in this request.

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:

      • EngineVersions — (Array<map>)

        A list of engine versions that are available to choose from.

        • SelectedEngineVersion — (String)

          The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

        • EffectiveEngineVersion — (String)

          Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

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 specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.

For code samples using the Amazon Web Services 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)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      The maximum number of queries to return in this request.

    • WorkGroup — (String)

      The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned.

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 generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Returns:

  • (AWS.Request)

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

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

Lists the prepared statements in the specfied workgroup.

Service Reference:

Examples:

Calling the listPreparedStatements operation

var params = {
  WorkGroup: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listPreparedStatements(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 workgroup to list the prepared statements for.

    • NextToken — (String)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      The maximum number of results to return in this request.

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:

      • PreparedStatements — (Array<map>)

        The list of prepared statements for the workgroup.

        • StatementName — (String)

          The name of the prepared statement.

        • LastModifiedTime — (Date)

          The last modified time of the prepared statement.

      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

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. 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 Amazon Web Services 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)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

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

    • WorkGroup — (String)

      The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.

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.

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

Lists the metadata for the tables in the specified data catalog database.

Service Reference:

Examples:

Calling the listTableMetadata operation

var params = {
  CatalogName: 'STRING_VALUE', /* required */
  DatabaseName: 'STRING_VALUE', /* required */
  Expression: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
athena.listTableMetadata(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: {})
    • CatalogName — (String)

      The name of the data catalog for which table metadata should be returned.

    • DatabaseName — (String)

      The name of the database for which table metadata should be returned.

    • Expression — (String)

      A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.

    • NextToken — (String)

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      Specifies the maximum number of results to return.

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:

      • TableMetadataList — (Array<map>)

        A list of table metadata.

        • Namerequired — (String)

          The name of the table.

        • CreateTime — (Date)

          The time that the table was created.

        • LastAccessTime — (Date)

          The last time the table was accessed.

        • TableType — (String)

          The type of table. In Athena, only EXTERNAL_TABLE is supported.

        • Columns — (Array<map>)

          A list of the columns in the table.

          • Namerequired — (String)

            The name of the column.

          • Type — (String)

            The data type of the column.

          • Comment — (String)

            Optional information about the column.

        • PartitionKeys — (Array<map>)

          A list of the partition keys in the table.

          • Namerequired — (String)

            The name of the column.

          • Type — (String)

            The data type of the column.

          • Comment — (String)

            Optional information about the column.

        • Parameters — (map<String>)

          A set of custom key/value pairs for table properties.

      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Returns:

  • (AWS.Request)

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

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

Lists the tags associated with an Athena workgroup or data catalog resource.

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 resource with the specified ARN.

    • NextToken — (String)

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

    • MaxResults — (Integer)

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

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 the specified resource.

        • 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 generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

    • MaxResults — (Integer)

      The maximum number of workgroups to return in this request.

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>)

        A list of WorkGroupSummary objects that include the names, descriptions, creation times, and states for each workgroup.

        • 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.

        • EngineVersion — (map)

          The engine version setting for all queries on the workgroup. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.

          • SelectedEngineVersion — (String)

            The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

          • EffectiveEngineVersion — (String)

            Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

      • NextToken — (String)

        A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

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. Running queries against an external catalog requires GetDataCatalog permission to the catalog. For code samples using the Amazon Web Services SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.

Service Reference:

Examples:

Calling the startQueryExecution operation

var params = {
  QueryString: 'STRING_VALUE', /* required */
  ClientRequestToken: 'STRING_VALUE',
  QueryExecutionContext: {
    Catalog: 'STRING_VALUE',
    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 Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.

      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 used in the query execution. The database must exist in the catalog.

      • Catalog — (String)

        The name of the data catalog used in the query execution.

    • ResultConfiguration — (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/. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using WorkGroupConfiguration. If none of them is set, Athena issues an error that no output location is provided. For more information, see Query Results. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

      • 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 Amazon Web Services 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 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.

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)

      Specifies the ARN of the Athena resource (workgroup or data catalog) to which tags are to be added.

    • Tags — (Array<map>)

      A collection of one or more tags, separated by commas, to be added to an Athena workgroup or data catalog resource.

      • 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 a data catalog or workgroup resource.

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)

      Specifies the ARN of the resource from which tags are to be removed.

    • TagKeys — (Array<String>)

      A comma-separated list of one or more tag keys whose tags are to be removed from the specified 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.

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

Updates the data catalog that has the specified name.

Service Reference:

Examples:

Calling the updateDataCatalog operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Type: LAMBDA | GLUE | HIVE, /* required */
  Description: 'STRING_VALUE',
  Parameters: {
    '<KeyString>': 'STRING_VALUE',
    /* '<KeyString>': ... */
  }
};
athena.updateDataCatalog(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 name of the data catalog to update. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.

    • Type — (String)

      Specifies the type of data catalog to update. Specify LAMBDA for a federated catalog, HIVE for an external hive metastore, or GLUE for an Glue Data Catalog.

      Possible values include:
      • "LAMBDA"
      • "GLUE"
      • "HIVE"
    • Description — (String)

      New or modified text that describes the data catalog.

    • Parameters — (map<String>)

      Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type.

      • For the HIVE data catalog type, use the following syntax. The metadata-function parameter is required. The sdk-version parameter is optional and defaults to the currently supported version.

        metadata-function=lambda_arn, sdk-version=version_number

      • For the LAMBDA data catalog type, use one of the following sets of required parameters, but not both.

        • If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.

          metadata-function=lambda_arn, record-function=lambda_arn

        • If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.

          function=lambda_arn

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.

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

Updates a prepared statement.

Service Reference:

Examples:

Calling the updatePreparedStatement operation

var params = {
  QueryStatement: 'STRING_VALUE', /* required */
  StatementName: 'STRING_VALUE', /* required */
  WorkGroup: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE'
};
athena.updatePreparedStatement(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: {})
    • StatementName — (String)

      The name of the prepared statement.

    • WorkGroup — (String)

      The workgroup for the prepared statement.

    • QueryStatement — (String)

      The query string for the prepared statement.

    • Description — (String)

      The description of the prepared statement.

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,
    EngineVersion: {
      EffectiveEngineVersion: 'STRING_VALUE',
      SelectedEngineVersion: 'STRING_VALUE'
    },
    PublishCloudWatchMetricsEnabled: true || false,
    RemoveBytesScannedCutoffPerQuery: true || false,
    RequesterPaysEnabled: 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 Query Results If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The "workgroup settings override" is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

        • 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

      • RequesterPaysEnabled — (Boolean)

        If set to true, allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set to false, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false. For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.

      • EngineVersion — (map)

        The engine version requested when a workgroup is updated. After the update, all queries on the workgroup run on the requested engine version. If no value was previously set, the default is Auto. Queries on the AmazonAthenaPreviewFunctionality workgroup run on the preview engine regardless of this setting.

        • SelectedEngineVersion — (String)

          The engine version requested by the user. Possible values are determined by the output of ListEngineVersions, including Auto. The default is Auto.

        • EffectiveEngineVersion — (String)

          Read only. The engine version on which the query runs. If the user requests a valid engine version other than Auto, the effective engine version is the same as the engine version that the user requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup operation, the EffectiveEngineVersion field is ignored.

    • 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.