Class: Aws::Athena::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb

Overview

An API client for Athena. To construct a client, you need to configure a :region and :credentials.

client = Aws::Athena::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentails or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :secret_access_key (String)
  • :session_token (String)
  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::Athena::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::Athena::EndpointParameters

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :ssl_timeout (Float) — default: nil

    Sets the SSL timeout in seconds.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.



375
376
377
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 375

def initialize(*args)
  super
end

Instance Method Details

#batch_get_named_query(params = {}) ⇒ Types::BatchGetNamedQueryOutput

Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use ListNamedQueriesInput to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under UnprocessedNamedQueryId. Named queries differ from executed queries. Use BatchGetQueryExecutionInput to get details about each unique query execution, and ListQueryExecutionsInput to get a list of query execution IDs.

Examples:

Request syntax with placeholder values


resp = client.batch_get_named_query({
  named_query_ids: ["NamedQueryId"], # required
})

Response structure


resp.named_queries #=> Array
resp.named_queries[0].name #=> String
resp.named_queries[0].description #=> String
resp.named_queries[0].database #=> String
resp.named_queries[0].query_string #=> String
resp.named_queries[0].named_query_id #=> String
resp.named_queries[0].work_group #=> String
resp.unprocessed_named_query_ids #=> Array
resp.unprocessed_named_query_ids[0].named_query_id #=> String
resp.unprocessed_named_query_ids[0].error_code #=> String
resp.unprocessed_named_query_ids[0].error_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :named_query_ids (required, Array<String>)

    An array of query IDs.

Returns:

See Also:



424
425
426
427
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 424

def batch_get_named_query(params = {}, options = {})
  req = build_request(:batch_get_named_query, params)
  req.send_request(options)
end

#batch_get_prepared_statement(params = {}) ⇒ Types::BatchGetPreparedStatementOutput

Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in UnprocessedPreparedStatementNames.

Examples:

Request syntax with placeholder values


resp = client.batch_get_prepared_statement({
  prepared_statement_names: ["StatementName"], # required
  work_group: "WorkGroupName", # required
})

Response structure


resp.prepared_statements #=> Array
resp.prepared_statements[0].statement_name #=> String
resp.prepared_statements[0].query_statement #=> String
resp.prepared_statements[0].work_group_name #=> String
resp.prepared_statements[0].description #=> String
resp.prepared_statements[0].last_modified_time #=> Time
resp.unprocessed_prepared_statement_names #=> Array
resp.unprocessed_prepared_statement_names[0].statement_name #=> String
resp.unprocessed_prepared_statement_names[0].error_code #=> String
resp.unprocessed_prepared_statement_names[0].error_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :prepared_statement_names (required, Array<String>)

    A list of prepared statement names to return.

  • :work_group (required, String)

    The name of the workgroup to which the prepared statements belong.

Returns:

See Also:



471
472
473
474
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 471

def batch_get_prepared_statement(params = {}, options = {})
  req = build_request(:batch_get_prepared_statement, params)
  req.send_request(options)
end

#batch_get_query_execution(params = {}) ⇒ Types::BatchGetQueryExecutionOutput

Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use ListQueryExecutionsInput$WorkGroup. Query executions differ from named (saved) queries. Use BatchGetNamedQueryInput to get details about named queries.

Examples:

Request syntax with placeholder values


resp = client.batch_get_query_execution({
  query_execution_ids: ["QueryExecutionId"], # required
})

Response structure


resp.query_executions #=> Array
resp.query_executions[0].query_execution_id #=> String
resp.query_executions[0].query #=> String
resp.query_executions[0].statement_type #=> String, one of "DDL", "DML", "UTILITY"
resp.query_executions[0].result_configuration.output_location #=> String
resp.query_executions[0].result_configuration.encryption_configuration.encryption_option #=> String, one of "SSE_S3", "SSE_KMS", "CSE_KMS"
resp.query_executions[0].result_configuration.encryption_configuration.kms_key #=> String
resp.query_executions[0].result_configuration.expected_bucket_owner #=> String
resp.query_executions[0].result_configuration.acl_configuration.s3_acl_option #=> String, one of "BUCKET_OWNER_FULL_CONTROL"
resp.query_executions[0].result_reuse_configuration.result_reuse_by_age_configuration.enabled #=> Boolean
resp.query_executions[0].result_reuse_configuration.result_reuse_by_age_configuration.max_age_in_minutes #=> Integer
resp.query_executions[0].query_execution_context.database #=> String
resp.query_executions[0].query_execution_context.catalog #=> String
resp.query_executions[0].status.state #=> String, one of "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"
resp.query_executions[0].status.state_change_reason #=> String
resp.query_executions[0].status.submission_date_time #=> Time
resp.query_executions[0].status.completion_date_time #=> Time
resp.query_executions[0].status.athena_error.error_category #=> Integer
resp.query_executions[0].status.athena_error.error_type #=> Integer
resp.query_executions[0].status.athena_error.retryable #=> Boolean
resp.query_executions[0].status.athena_error.error_message #=> String
resp.query_executions[0].statistics.engine_execution_time_in_millis #=> Integer
resp.query_executions[0].statistics.data_scanned_in_bytes #=> Integer
resp.query_executions[0].statistics.data_manifest_location #=> String
resp.query_executions[0].statistics.total_execution_time_in_millis #=> Integer
resp.query_executions[0].statistics.query_queue_time_in_millis #=> Integer
resp.query_executions[0].statistics.query_planning_time_in_millis #=> Integer
resp.query_executions[0].statistics.service_processing_time_in_millis #=> Integer
resp.query_executions[0].statistics.result_reuse_information.reused_previous_result #=> Boolean
resp.query_executions[0].work_group #=> String
resp.query_executions[0].engine_version.selected_engine_version #=> String
resp.query_executions[0].engine_version.effective_engine_version #=> String
resp.query_executions[0].execution_parameters #=> Array
resp.query_executions[0].execution_parameters[0] #=> String
resp.query_executions[0].substatement_type #=> String
resp.unprocessed_query_execution_ids #=> Array
resp.unprocessed_query_execution_ids[0].query_execution_id #=> String
resp.unprocessed_query_execution_ids[0].error_code #=> String
resp.unprocessed_query_execution_ids[0].error_message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_execution_ids (required, Array<String>)

    An array of query execution IDs.

Returns:

See Also:



544
545
546
547
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 544

def batch_get_query_execution(params = {}, options = {})
  req = build_request(:batch_get_query_execution, params)
  req.send_request(options)
end

#create_data_catalog(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.create_data_catalog({
  name: "CatalogNameString", # required
  type: "LAMBDA", # required, accepts LAMBDA, GLUE, HIVE
  description: "DescriptionString",
  parameters: {
    "KeyString" => "ParametersMapValue",
  },
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, 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 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.

  • :type (required, 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.

  • :description (String)

    A description of the data catalog to be created.

  • :parameters (Hash<String,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<Types::Tag>)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



639
640
641
642
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 639

def create_data_catalog(params = {}, options = {})
  req = build_request(:create_data_catalog, params)
  req.send_request(options)
end

#create_named_query(params = {}) ⇒ Types::CreateNamedQueryOutput

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.

Examples:

Request syntax with placeholder values


resp = client.create_named_query({
  name: "NameString", # required
  description: "DescriptionString",
  database: "DatabaseString", # required
  query_string: "QueryString", # required
  client_request_token: "IdempotencyToken",
  work_group: "WorkGroupName",
})

Response structure


resp.named_query_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The query name.

  • :description (String)

    The query description.

  • :database (required, String)

    The database to which the query belongs.

  • :query_string (required, String)

    The contents of the query with all query statements.

  • :client_request_token (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.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :work_group (String)

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

Returns:

See Also:



708
709
710
711
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 708

def create_named_query(params = {}, options = {})
  req = build_request(:create_named_query, params)
  req.send_request(options)
end

#create_notebook(params = {}) ⇒ Types::CreateNotebookOutput

Creates an empty ipynb file in the specified Apache Spark enabled workgroup. Throws an error if a file in the workgroup with the same name already exists.

Examples:

Request syntax with placeholder values


resp = client.create_notebook({
  work_group: "WorkGroupName", # required
  name: "NotebookName", # required
  client_request_token: "ClientRequestToken",
})

Response structure


resp.notebook_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The name of the Spark enabled workgroup in which the notebook will be created.

  • :name (required, String)

    The name of the ipynb file to be created in the Spark workgroup, without the .ipynb extension.

  • :client_request_token (String)

    A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).

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

Returns:

See Also:



755
756
757
758
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 755

def create_notebook(params = {}, options = {})
  req = build_request(:create_notebook, params)
  req.send_request(options)
end

#create_prepared_statement(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.create_prepared_statement({
  statement_name: "StatementName", # required
  work_group: "WorkGroupName", # required
  query_statement: "QueryString", # required
  description: "DescriptionString",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :statement_name (required, String)

    The name of the prepared statement.

  • :work_group (required, String)

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

  • :query_statement (required, String)

    The query string for the prepared statement.

  • :description (String)

    The description of the prepared statement.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



789
790
791
792
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 789

def create_prepared_statement(params = {}, options = {})
  req = build_request(:create_prepared_statement, params)
  req.send_request(options)
end

#create_presigned_notebook_url(params = {}) ⇒ Types::CreatePresignedNotebookUrlResponse

Gets an authentication token and the URL at which the notebook can be accessed. During programmatic access, CreatePresignedNotebookUrl must be called every 10 minutes to refresh the authentication token. For information about granting programmatic access, see Grant programmatic access.

Examples:

Request syntax with placeholder values


resp = client.create_presigned_notebook_url({
  session_id: "SessionId", # required
})

Response structure


resp.notebook_url #=> String
resp.auth_token #=> String
resp.auth_token_expiration_time #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

Returns:

See Also:



829
830
831
832
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 829

def create_presigned_notebook_url(params = {}, options = {})
  req = build_request(:create_presigned_notebook_url, params)
  req.send_request(options)
end

#create_work_group(params = {}) ⇒ Struct

Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup.

Examples:

Request syntax with placeholder values


resp = client.create_work_group({
  name: "WorkGroupName", # required
  configuration: {
    result_configuration: {
      output_location: "ResultOutputLocation",
      encryption_configuration: {
        encryption_option: "SSE_S3", # required, accepts SSE_S3, SSE_KMS, CSE_KMS
        kms_key: "String",
      },
      expected_bucket_owner: "AwsAccountId",
      acl_configuration: {
        s3_acl_option: "BUCKET_OWNER_FULL_CONTROL", # required, accepts BUCKET_OWNER_FULL_CONTROL
      },
    },
    enforce_work_group_configuration: false,
    publish_cloud_watch_metrics_enabled: false,
    bytes_scanned_cutoff_per_query: 1,
    requester_pays_enabled: false,
    engine_version: {
      selected_engine_version: "NameString",
      effective_engine_version: "NameString",
    },
    additional_configuration: "NameString",
    execution_role: "RoleArn",
    customer_content_encryption_configuration: {
      kms_key: "KmsKey", # required
    },
    enable_minimum_encryption_configuration: false,
  },
  description: "WorkGroupDescriptionString",
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The workgroup name.

  • :configuration (Types::WorkGroupConfiguration)

    Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with EnforceWorkGroupConfiguration) in the WorkGroupConfiguration override client-side settings. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.

  • :description (String)

    The workgroup description.

  • :tags (Array<Types::Tag>)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



905
906
907
908
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 905

def create_work_group(params = {}, options = {})
  req = build_request(:create_work_group, params)
  req.send_request(options)
end

#delete_data_catalog(params = {}) ⇒ Struct

Deletes a data catalog.

Examples:

Request syntax with placeholder values


resp = client.delete_data_catalog({
  name: "CatalogNameString", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the data catalog to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



927
928
929
930
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 927

def delete_data_catalog(params = {}, options = {})
  req = build_request(:delete_data_catalog, params)
  req.send_request(options)
end

#delete_named_query(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.delete_named_query({
  named_query_id: "NamedQueryId", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :named_query_id (required, String)

    The unique ID of the query to delete.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

  • (Struct)

    Returns an empty response.

See Also:



960
961
962
963
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 960

def delete_named_query(params = {}, options = {})
  req = build_request(:delete_named_query, params)
  req.send_request(options)
end

#delete_notebook(params = {}) ⇒ Struct

Deletes the specified notebook.

Examples:

Request syntax with placeholder values


resp = client.delete_notebook({
  notebook_id: "NotebookId", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



982
983
984
985
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 982

def delete_notebook(params = {}, options = {})
  req = build_request(:delete_notebook, params)
  req.send_request(options)
end

#delete_prepared_statement(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.delete_prepared_statement({
  statement_name: "StatementName", # required
  work_group: "WorkGroupName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :statement_name (required, String)

    The name of the prepared statement to delete.

  • :work_group (required, String)

    The workgroup to which the statement to be deleted belongs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1009
1010
1011
1012
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1009

def delete_prepared_statement(params = {}, options = {})
  req = build_request(:delete_prepared_statement, params)
  req.send_request(options)
end

#delete_work_group(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.delete_work_group({
  work_group: "WorkGroupName", # required
  recursive_delete_option: false,
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The unique name of the workgroup to delete.

  • :recursive_delete_option (Boolean)

    The option to delete the workgroup and its contents even if the workgroup contains any named queries, query executions, or notebooks.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1037
1038
1039
1040
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1037

def delete_work_group(params = {}, options = {})
  req = build_request(:delete_work_group, params)
  req.send_request(options)
end

#export_notebook(params = {}) ⇒ Types::ExportNotebookOutput

Exports the specified notebook and its metadata.

Examples:

Request syntax with placeholder values


resp = client.export_notebook({
  notebook_id: "NotebookId", # required
})

Response structure


resp..notebook_id #=> String
resp..name #=> String
resp..work_group #=> String
resp..creation_time #=> Time
resp..type #=> String, one of "IPYNB"
resp..last_modified_time #=> Time
resp.payload #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook to export.

Returns:

See Also:



1072
1073
1074
1075
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1072

def export_notebook(params = {}, options = {})
  req = build_request(:export_notebook, params)
  req.send_request(options)
end

#get_calculation_execution(params = {}) ⇒ Types::GetCalculationExecutionResponse

Describes a previously submitted calculation execution.

Examples:

Request syntax with placeholder values


resp = client.get_calculation_execution({
  calculation_execution_id: "CalculationExecutionId", # required
})

Response structure


resp.calculation_execution_id #=> String
resp.session_id #=> String
resp.description #=> String
resp.working_directory #=> String
resp.status.submission_date_time #=> Time
resp.status.completion_date_time #=> Time
resp.status.state #=> String, one of "CREATING", "CREATED", "QUEUED", "RUNNING", "CANCELING", "CANCELED", "COMPLETED", "FAILED"
resp.status.state_change_reason #=> String
resp.statistics.dpu_execution_in_millis #=> Integer
resp.statistics.progress #=> String
resp.result.std_out_s3_uri #=> String
resp.result.std_error_s3_uri #=> String
resp.result.result_s3_uri #=> String
resp.result.result_type #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :calculation_execution_id (required, String)

    The calculation execution UUID.

Returns:

See Also:



1119
1120
1121
1122
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1119

def get_calculation_execution(params = {}, options = {})
  req = build_request(:get_calculation_execution, params)
  req.send_request(options)
end

#get_calculation_execution_code(params = {}) ⇒ Types::GetCalculationExecutionCodeResponse

Retrieves the unencrypted code that was executed for the calculation.

Examples:

Request syntax with placeholder values


resp = client.get_calculation_execution_code({
  calculation_execution_id: "CalculationExecutionId", # required
})

Response structure


resp.code_block #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :calculation_execution_id (required, String)

    The calculation execution UUID.

Returns:

See Also:



1147
1148
1149
1150
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1147

def get_calculation_execution_code(params = {}, options = {})
  req = build_request(:get_calculation_execution_code, params)
  req.send_request(options)
end

#get_calculation_execution_status(params = {}) ⇒ Types::GetCalculationExecutionStatusResponse

Gets the status of a current calculation.

Examples:

Request syntax with placeholder values


resp = client.get_calculation_execution_status({
  calculation_execution_id: "CalculationExecutionId", # required
})

Response structure


resp.status.submission_date_time #=> Time
resp.status.completion_date_time #=> Time
resp.status.state #=> String, one of "CREATING", "CREATED", "QUEUED", "RUNNING", "CANCELING", "CANCELED", "COMPLETED", "FAILED"
resp.status.state_change_reason #=> String
resp.statistics.dpu_execution_in_millis #=> Integer
resp.statistics.progress #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :calculation_execution_id (required, String)

    The calculation execution UUID.

Returns:

See Also:



1181
1182
1183
1184
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1181

def get_calculation_execution_status(params = {}, options = {})
  req = build_request(:get_calculation_execution_status, params)
  req.send_request(options)
end

#get_data_catalog(params = {}) ⇒ Types::GetDataCatalogOutput

Returns the specified data catalog.

Examples:

Request syntax with placeholder values


resp = client.get_data_catalog({
  name: "CatalogNameString", # required
})

Response structure


resp.data_catalog.name #=> String
resp.data_catalog.description #=> String
resp.data_catalog.type #=> String, one of "LAMBDA", "GLUE", "HIVE"
resp.data_catalog.parameters #=> Hash
resp.data_catalog.parameters["KeyString"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the data catalog to return.

Returns:

See Also:



1213
1214
1215
1216
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1213

def get_data_catalog(params = {}, options = {})
  req = build_request(:get_data_catalog, params)
  req.send_request(options)
end

#get_database(params = {}) ⇒ Types::GetDatabaseOutput

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

Examples:

Request syntax with placeholder values


resp = client.get_database({
  catalog_name: "CatalogNameString", # required
  database_name: "NameString", # required
})

Response structure


resp.database.name #=> String
resp.database.description #=> String
resp.database.parameters #=> Hash
resp.database.parameters["KeyString"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :catalog_name (required, String)

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

  • :database_name (required, String)

    The name of the database to return.

Returns:

See Also:



1248
1249
1250
1251
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1248

def get_database(params = {}, options = {})
  req = build_request(:get_database, params)
  req.send_request(options)
end

#get_named_query(params = {}) ⇒ Types::GetNamedQueryOutput

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

Examples:

Request syntax with placeholder values


resp = client.get_named_query({
  named_query_id: "NamedQueryId", # required
})

Response structure


resp.named_query.name #=> String
resp.named_query.description #=> String
resp.named_query.database #=> String
resp.named_query.query_string #=> String
resp.named_query.named_query_id #=> String
resp.named_query.work_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :named_query_id (required, String)

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

Returns:

See Also:



1282
1283
1284
1285
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1282

def get_named_query(params = {}, options = {})
  req = build_request(:get_named_query, params)
  req.send_request(options)
end

#get_notebook_metadata(params = {}) ⇒ Types::GetNotebookMetadataOutput

Retrieves notebook metadata for the specified notebook ID.

Examples:

Request syntax with placeholder values


resp = client.({
  notebook_id: "NotebookId", # required
})

Response structure


resp..notebook_id #=> String
resp..name #=> String
resp..work_group #=> String
resp..creation_time #=> Time
resp..type #=> String, one of "IPYNB"
resp..last_modified_time #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook whose metadata is to be retrieved.

Returns:

See Also:



1315
1316
1317
1318
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1315

def (params = {}, options = {})
  req = build_request(:get_notebook_metadata, params)
  req.send_request(options)
end

#get_prepared_statement(params = {}) ⇒ Types::GetPreparedStatementOutput

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

Examples:

Request syntax with placeholder values


resp = client.get_prepared_statement({
  statement_name: "StatementName", # required
  work_group: "WorkGroupName", # required
})

Response structure


resp.prepared_statement.statement_name #=> String
resp.prepared_statement.query_statement #=> String
resp.prepared_statement.work_group_name #=> String
resp.prepared_statement.description #=> String
resp.prepared_statement.last_modified_time #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :statement_name (required, String)

    The name of the prepared statement to retrieve.

  • :work_group (required, String)

    The workgroup to which the statement to be retrieved belongs.

Returns:

See Also:



1352
1353
1354
1355
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1352

def get_prepared_statement(params = {}, options = {})
  req = build_request(:get_prepared_statement, params)
  req.send_request(options)
end

#get_query_execution(params = {}) ⇒ Types::GetQueryExecutionOutput

Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.

Examples:

Request syntax with placeholder values


resp = client.get_query_execution({
  query_execution_id: "QueryExecutionId", # required
})

Response structure


resp.query_execution.query_execution_id #=> String
resp.query_execution.query #=> String
resp.query_execution.statement_type #=> String, one of "DDL", "DML", "UTILITY"
resp.query_execution.result_configuration.output_location #=> String
resp.query_execution.result_configuration.encryption_configuration.encryption_option #=> String, one of "SSE_S3", "SSE_KMS", "CSE_KMS"
resp.query_execution.result_configuration.encryption_configuration.kms_key #=> String
resp.query_execution.result_configuration.expected_bucket_owner #=> String
resp.query_execution.result_configuration.acl_configuration.s3_acl_option #=> String, one of "BUCKET_OWNER_FULL_CONTROL"
resp.query_execution.result_reuse_configuration.result_reuse_by_age_configuration.enabled #=> Boolean
resp.query_execution.result_reuse_configuration.result_reuse_by_age_configuration.max_age_in_minutes #=> Integer
resp.query_execution.query_execution_context.database #=> String
resp.query_execution.query_execution_context.catalog #=> String
resp.query_execution.status.state #=> String, one of "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED"
resp.query_execution.status.state_change_reason #=> String
resp.query_execution.status.submission_date_time #=> Time
resp.query_execution.status.completion_date_time #=> Time
resp.query_execution.status.athena_error.error_category #=> Integer
resp.query_execution.status.athena_error.error_type #=> Integer
resp.query_execution.status.athena_error.retryable #=> Boolean
resp.query_execution.status.athena_error.error_message #=> String
resp.query_execution.statistics.engine_execution_time_in_millis #=> Integer
resp.query_execution.statistics.data_scanned_in_bytes #=> Integer
resp.query_execution.statistics.data_manifest_location #=> String
resp.query_execution.statistics.total_execution_time_in_millis #=> Integer
resp.query_execution.statistics.query_queue_time_in_millis #=> Integer
resp.query_execution.statistics.query_planning_time_in_millis #=> Integer
resp.query_execution.statistics.service_processing_time_in_millis #=> Integer
resp.query_execution.statistics.result_reuse_information.reused_previous_result #=> Boolean
resp.query_execution.work_group #=> String
resp.query_execution.engine_version.selected_engine_version #=> String
resp.query_execution.engine_version.effective_engine_version #=> String
resp.query_execution.execution_parameters #=> Array
resp.query_execution.execution_parameters[0] #=> String
resp.query_execution.substatement_type #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_execution_id (required, String)

    The unique ID of the query execution.

Returns:

See Also:



1416
1417
1418
1419
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1416

def get_query_execution(params = {}, options = {})
  req = build_request(:get_query_execution, params)
  req.send_request(options)
end

#get_query_results(params = {}) ⇒ Types::GetQueryResultsOutput

Streams the results of a single query execution specified by QueryExecutionId from the Athena query results location in Amazon S3. For more information, see Working with query results, recent queries, and output files 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.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.get_query_results({
  query_execution_id: "QueryExecutionId", # required
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.update_count #=> Integer
resp.result_set.rows #=> Array
resp.result_set.rows[0].data #=> Array
resp.result_set.rows[0].data[0].var_char_value #=> String
resp.result_set..column_info #=> Array
resp.result_set..column_info[0].catalog_name #=> String
resp.result_set..column_info[0].schema_name #=> String
resp.result_set..column_info[0].table_name #=> String
resp.result_set..column_info[0].name #=> String
resp.result_set..column_info[0].label #=> String
resp.result_set..column_info[0].type #=> String
resp.result_set..column_info[0].precision #=> Integer
resp.result_set..column_info[0].scale #=> Integer
resp.result_set..column_info[0].nullable #=> String, one of "NOT_NULL", "NULLABLE", "UNKNOWN"
resp.result_set..column_info[0].case_sensitive #=> Boolean
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_execution_id (required, String)

    The unique ID of the query execution.

  • :next_token (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.

  • :max_results (Integer)

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

Returns:

See Also:



1493
1494
1495
1496
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1493

def get_query_results(params = {}, options = {})
  req = build_request(:get_query_results, params)
  req.send_request(options)
end

#get_query_runtime_statistics(params = {}) ⇒ Types::GetQueryRuntimeStatisticsOutput

Returns query execution runtime statistics related to a single execution of a query if you have access to the workgroup in which the query ran. Query execution runtime statistics are returned only when QueryExecutionStatus$State is in a SUCCEEDED or FAILED state. Stage-level input and output row count and data size statistics are not shown when a query has row-level filters defined in Lake Formation.

Examples:

Request syntax with placeholder values


resp = client.get_query_runtime_statistics({
  query_execution_id: "QueryExecutionId", # required
})

Response structure


resp.query_runtime_statistics.timeline.query_queue_time_in_millis #=> Integer
resp.query_runtime_statistics.timeline.query_planning_time_in_millis #=> Integer
resp.query_runtime_statistics.timeline.engine_execution_time_in_millis #=> Integer
resp.query_runtime_statistics.timeline.service_processing_time_in_millis #=> Integer
resp.query_runtime_statistics.timeline.total_execution_time_in_millis #=> Integer
resp.query_runtime_statistics.rows.input_rows #=> Integer
resp.query_runtime_statistics.rows.input_bytes #=> Integer
resp.query_runtime_statistics.rows.output_bytes #=> Integer
resp.query_runtime_statistics.rows.output_rows #=> Integer
resp.query_runtime_statistics.output_stage.stage_id #=> Integer
resp.query_runtime_statistics.output_stage.state #=> String
resp.query_runtime_statistics.output_stage.output_bytes #=> Integer
resp.query_runtime_statistics.output_stage.output_rows #=> Integer
resp.query_runtime_statistics.output_stage.input_bytes #=> Integer
resp.query_runtime_statistics.output_stage.input_rows #=> Integer
resp.query_runtime_statistics.output_stage.execution_time #=> Integer
resp.query_runtime_statistics.output_stage.query_stage_plan.name #=> String
resp.query_runtime_statistics.output_stage.query_stage_plan.identifier #=> String
resp.query_runtime_statistics.output_stage.query_stage_plan.children #=> Array
resp.query_runtime_statistics.output_stage.query_stage_plan.children[0] #=> Types::QueryStagePlanNode
resp.query_runtime_statistics.output_stage.query_stage_plan.remote_sources #=> Array
resp.query_runtime_statistics.output_stage.query_stage_plan.remote_sources[0] #=> String
resp.query_runtime_statistics.output_stage.sub_stages #=> Array
resp.query_runtime_statistics.output_stage.sub_stages[0] #=> Types::QueryStage

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_execution_id (required, String)

    The unique ID of the query execution.

Returns:

See Also:



1550
1551
1552
1553
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1550

def get_query_runtime_statistics(params = {}, options = {})
  req = build_request(:get_query_runtime_statistics, params)
  req.send_request(options)
end

#get_session(params = {}) ⇒ Types::GetSessionResponse

Gets the full details of a previously created session, including the session status and configuration.

Examples:

Request syntax with placeholder values


resp = client.get_session({
  session_id: "SessionId", # required
})

Response structure


resp.session_id #=> String
resp.description #=> String
resp.work_group #=> String
resp.engine_version #=> String
resp.engine_configuration.coordinator_dpu_size #=> Integer
resp.engine_configuration.max_concurrent_dpus #=> Integer
resp.engine_configuration.default_executor_dpu_size #=> Integer
resp.engine_configuration.additional_configs #=> Hash
resp.engine_configuration.additional_configs["KeyString"] #=> String
resp.notebook_version #=> String
resp.session_configuration.execution_role #=> String
resp.session_configuration.working_directory #=> String
resp.session_configuration.idle_timeout_seconds #=> Integer
resp.session_configuration.encryption_configuration.encryption_option #=> String, one of "SSE_S3", "SSE_KMS", "CSE_KMS"
resp.session_configuration.encryption_configuration.kms_key #=> String
resp.status.start_date_time #=> Time
resp.status.last_modified_date_time #=> Time
resp.status.end_date_time #=> Time
resp.status.idle_since_date_time #=> Time
resp.status.state #=> String, one of "CREATING", "CREATED", "IDLE", "BUSY", "TERMINATING", "TERMINATED", "DEGRADED", "FAILED"
resp.status.state_change_reason #=> String
resp.statistics.dpu_execution_in_millis #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

Returns:

See Also:



1608
1609
1610
1611
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1608

def get_session(params = {}, options = {})
  req = build_request(:get_session, params)
  req.send_request(options)
end

#get_session_status(params = {}) ⇒ Types::GetSessionStatusResponse

Gets the current status of a session.

Examples:

Request syntax with placeholder values


resp = client.get_session_status({
  session_id: "SessionId", # required
})

Response structure


resp.session_id #=> String
resp.status.start_date_time #=> Time
resp.status.last_modified_date_time #=> Time
resp.status.end_date_time #=> Time
resp.status.idle_since_date_time #=> Time
resp.status.state #=> String, one of "CREATING", "CREATED", "IDLE", "BUSY", "TERMINATING", "TERMINATED", "DEGRADED", "FAILED"
resp.status.state_change_reason #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

Returns:

See Also:



1643
1644
1645
1646
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1643

def get_session_status(params = {}, options = {})
  req = build_request(:get_session_status, params)
  req.send_request(options)
end

#get_table_metadata(params = {}) ⇒ Types::GetTableMetadataOutput

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

Examples:

Request syntax with placeholder values


resp = client.({
  catalog_name: "CatalogNameString", # required
  database_name: "NameString", # required
  table_name: "NameString", # required
})

Response structure


resp..name #=> String
resp..create_time #=> Time
resp..last_access_time #=> Time
resp..table_type #=> String
resp..columns #=> Array
resp..columns[0].name #=> String
resp..columns[0].type #=> String
resp..columns[0].comment #=> String
resp..partition_keys #=> Array
resp..partition_keys[0].name #=> String
resp..partition_keys[0].type #=> String
resp..partition_keys[0].comment #=> String
resp..parameters #=> Hash
resp..parameters["KeyString"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :catalog_name (required, String)

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

  • :database_name (required, String)

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

  • :table_name (required, String)

    The name of the table for which metadata is returned.

Returns:

See Also:



1693
1694
1695
1696
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1693

def (params = {}, options = {})
  req = build_request(:get_table_metadata, params)
  req.send_request(options)
end

#get_work_group(params = {}) ⇒ Types::GetWorkGroupOutput

Returns information about the workgroup with the specified name.

Examples:

Request syntax with placeholder values


resp = client.get_work_group({
  work_group: "WorkGroupName", # required
})

Response structure


resp.work_group.name #=> String
resp.work_group.state #=> String, one of "ENABLED", "DISABLED"
resp.work_group.configuration.result_configuration.output_location #=> String
resp.work_group.configuration.result_configuration.encryption_configuration.encryption_option #=> String, one of "SSE_S3", "SSE_KMS", "CSE_KMS"
resp.work_group.configuration.result_configuration.encryption_configuration.kms_key #=> String
resp.work_group.configuration.result_configuration.expected_bucket_owner #=> String
resp.work_group.configuration.result_configuration.acl_configuration.s3_acl_option #=> String, one of "BUCKET_OWNER_FULL_CONTROL"
resp.work_group.configuration.enforce_work_group_configuration #=> Boolean
resp.work_group.configuration.publish_cloud_watch_metrics_enabled #=> Boolean
resp.work_group.configuration.bytes_scanned_cutoff_per_query #=> Integer
resp.work_group.configuration.requester_pays_enabled #=> Boolean
resp.work_group.configuration.engine_version.selected_engine_version #=> String
resp.work_group.configuration.engine_version.effective_engine_version #=> String
resp.work_group.configuration.additional_configuration #=> String
resp.work_group.configuration.execution_role #=> String
resp.work_group.configuration.customer_content_encryption_configuration.kms_key #=> String
resp.work_group.configuration.enable_minimum_encryption_configuration #=> Boolean
resp.work_group.description #=> String
resp.work_group.creation_time #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The name of the workgroup.

Returns:

See Also:



1739
1740
1741
1742
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1739

def get_work_group(params = {}, options = {})
  req = build_request(:get_work_group, params)
  req.send_request(options)
end

#import_notebook(params = {}) ⇒ Types::ImportNotebookOutput

Imports a single ipynb file to a Spark enabled workgroup. The maximum file size that can be imported is 10 megabytes. If an ipynb file with the same name already exists in the workgroup, throws an error.

Examples:

Request syntax with placeholder values


resp = client.import_notebook({
  work_group: "WorkGroupName", # required
  name: "NotebookName", # required
  payload: "Payload", # required
  type: "IPYNB", # required, accepts IPYNB
  client_request_token: "ClientRequestToken",
})

Response structure


resp.notebook_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The name of the Spark enabled workgroup to import the notebook to.

  • :name (required, String)

    The name of the notebook to import.

  • :payload (required, String)

    The notebook content to be imported.

  • :type (required, String)

    The notebook content type. Currently, the only valid type is IPYNB.

  • :client_request_token (String)

    A unique case-sensitive string used to ensure the request to import the notebook is idempotent (executes only once).

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

Returns:

See Also:



1793
1794
1795
1796
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1793

def import_notebook(params = {}, options = {})
  req = build_request(:import_notebook, params)
  req.send_request(options)
end

#list_application_dpu_sizes(params = {}) ⇒ Types::ListApplicationDPUSizesOutput

Returns the supported DPU sizes for the supported application runtimes (for example, Athena notebook version 1).

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_application_dpu_sizes({
  max_results: 1,
  next_token: "Token",
})

Response structure


resp.application_dpu_sizes #=> Array
resp.application_dpu_sizes[0].application_runtime_id #=> String
resp.application_dpu_sizes[0].supported_dpu_sizes #=> Array
resp.application_dpu_sizes[0].supported_dpu_sizes[0] #=> Integer
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :max_results (Integer)

    Specifies the maximum number of results to return.

  • :next_token (String)

    A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.

Returns:

See Also:



1834
1835
1836
1837
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1834

def list_application_dpu_sizes(params = {}, options = {})
  req = build_request(:list_application_dpu_sizes, params)
  req.send_request(options)
end

#list_calculation_executions(params = {}) ⇒ Types::ListCalculationExecutionsResponse

Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_calculation_executions({
  session_id: "SessionId", # required
  state_filter: "CREATING", # accepts CREATING, CREATED, QUEUED, RUNNING, CANCELING, CANCELED, COMPLETED, FAILED
  max_results: 1,
  next_token: "SessionManagerToken",
})

Response structure


resp.next_token #=> String
resp.calculations #=> Array
resp.calculations[0].calculation_execution_id #=> String
resp.calculations[0].description #=> String
resp.calculations[0].status.submission_date_time #=> Time
resp.calculations[0].status.completion_date_time #=> Time
resp.calculations[0].status.state #=> String, one of "CREATING", "CREATED", "QUEUED", "RUNNING", "CANCELING", "CANCELED", "COMPLETED", "FAILED"
resp.calculations[0].status.state_change_reason #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

  • :state_filter (String)

    A filter for a specific calculation execution state. A description of each state follows.

    CREATING - The calculation is in the process of being created.

    CREATED - The calculation has been created and is ready to run.

    QUEUED - The calculation has been queued for processing.

    RUNNING - The calculation is running.

    CANCELING - A request to cancel the calculation has been received and the system is working to stop it.

    CANCELED - The calculation is no longer running as the result of a cancel request.

    COMPLETED - The calculation has completed without error.

    FAILED - The calculation failed and is no longer running.

  • :max_results (Integer)

    The maximum number of calculation executions to return.

  • :next_token (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:

See Also:



1908
1909
1910
1911
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1908

def list_calculation_executions(params = {}, options = {})
  req = build_request(:list_calculation_executions, params)
  req.send_request(options)
end

#list_data_catalogs(params = {}) ⇒ Types::ListDataCatalogsOutput

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

In the Athena console, data catalogs are listed as "data sources" on the Data sources page under the Data source name column.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_data_catalogs({
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.data_catalogs_summary #=> Array
resp.data_catalogs_summary[0].catalog_name #=> String
resp.data_catalogs_summary[0].type #=> String, one of "LAMBDA", "GLUE", "HIVE"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (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.

  • :max_results (Integer)

    Specifies the maximum number of data catalogs to return.

Returns:

See Also:



1954
1955
1956
1957
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1954

def list_data_catalogs(params = {}, options = {})
  req = build_request(:list_data_catalogs, params)
  req.send_request(options)
end

#list_databases(params = {}) ⇒ Types::ListDatabasesOutput

Lists the databases in the specified data catalog.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_databases({
  catalog_name: "CatalogNameString", # required
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.database_list #=> Array
resp.database_list[0].name #=> String
resp.database_list[0].description #=> String
resp.database_list[0].parameters #=> Hash
resp.database_list[0].parameters["KeyString"] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :catalog_name (required, String)

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

  • :next_token (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.

  • :max_results (Integer)

    Specifies the maximum number of results to return.

Returns:

See Also:



2001
2002
2003
2004
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2001

def list_databases(params = {}, options = {})
  req = build_request(:list_databases, params)
  req.send_request(options)
end

#list_engine_versions(params = {}) ⇒ Types::ListEngineVersionsOutput

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_engine_versions({
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.engine_versions #=> Array
resp.engine_versions[0].selected_engine_version #=> String
resp.engine_versions[0].effective_engine_version #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (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.

  • :max_results (Integer)

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

Returns:

See Also:



2043
2044
2045
2046
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2043

def list_engine_versions(params = {}, options = {})
  req = build_request(:list_engine_versions, params)
  req.send_request(options)
end

#list_executors(params = {}) ⇒ Types::ListExecutorsResponse

Lists, in descending order, the executors that joined a session. Newer executors are listed first; older executors are listed later. The result can be optionally filtered by state.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_executors({
  session_id: "SessionId", # required
  executor_state_filter: "CREATING", # accepts CREATING, CREATED, REGISTERED, TERMINATING, TERMINATED, FAILED
  max_results: 1,
  next_token: "SessionManagerToken",
})

Response structure


resp.session_id #=> String
resp.next_token #=> String
resp.executors_summary #=> Array
resp.executors_summary[0].executor_id #=> String
resp.executors_summary[0].executor_type #=> String, one of "COORDINATOR", "GATEWAY", "WORKER"
resp.executors_summary[0].start_date_time #=> Integer
resp.executors_summary[0].termination_date_time #=> Integer
resp.executors_summary[0].executor_state #=> String, one of "CREATING", "CREATED", "REGISTERED", "TERMINATING", "TERMINATED", "FAILED"
resp.executors_summary[0].executor_size #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

  • :executor_state_filter (String)

    A filter for a specific executor state. A description of each state follows.

    CREATING - The executor is being started, including acquiring resources.

    CREATED - The executor has been started.

    REGISTERED - The executor has been registered.

    TERMINATING - The executor is in the process of shutting down.

    TERMINATED - The executor is no longer running.

    FAILED - Due to a failure, the executor is no longer running.

  • :max_results (Integer)

    The maximum number of executors to return.

  • :next_token (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:

See Also:



2114
2115
2116
2117
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2114

def list_executors(params = {}, options = {})
  req = build_request(:list_executors, params)
  req.send_request(options)
end

#list_named_queries(params = {}) ⇒ Types::ListNamedQueriesOutput

Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_named_queries({
  next_token: "Token",
  max_results: 1,
  work_group: "WorkGroupName",
})

Response structure


resp.named_query_ids #=> Array
resp.named_query_ids[0] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (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.

  • :max_results (Integer)

    The maximum number of queries to return in this request.

  • :work_group (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.

Returns:

See Also:



2170
2171
2172
2173
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2170

def list_named_queries(params = {}, options = {})
  req = build_request(:list_named_queries, params)
  req.send_request(options)
end

#list_notebook_metadata(params = {}) ⇒ Types::ListNotebookMetadataOutput

Displays the notebook files for the specified workgroup in paginated format.

Examples:

Request syntax with placeholder values


resp = client.({
  filters: {
    name: "NotebookName",
  },
  next_token: "Token",
  max_results: 1,
  work_group: "WorkGroupName", # required
})

Response structure


resp.next_token #=> String
resp. #=> Array
resp.[0].notebook_id #=> String
resp.[0].name #=> String
resp.[0].work_group #=> String
resp.[0].creation_time #=> Time
resp.[0].type #=> String, one of "IPYNB"
resp.[0].last_modified_time #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :filters (Types::FilterDefinition)

    Search filter string.

  • :next_token (String)

    A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.

  • :max_results (Integer)

    Specifies the maximum number of results to return.

  • :work_group (required, String)

    The name of the Spark enabled workgroup to retrieve notebook metadata for.

Returns:

See Also:



2223
2224
2225
2226
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2223

def (params = {}, options = {})
  req = build_request(:list_notebook_metadata, params)
  req.send_request(options)
end

#list_notebook_sessions(params = {}) ⇒ Types::ListNotebookSessionsResponse

Lists, in descending order, the sessions that have been created in a notebook that are in an active state like CREATING, CREATED, IDLE or BUSY. Newer sessions are listed first; older sessions are listed later.

Examples:

Request syntax with placeholder values


resp = client.list_notebook_sessions({
  notebook_id: "NotebookId", # required
  max_results: 1,
  next_token: "Token",
})

Response structure


resp.notebook_sessions_list #=> Array
resp.notebook_sessions_list[0].session_id #=> String
resp.notebook_sessions_list[0].creation_time #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook to list sessions for.

  • :max_results (Integer)

    The maximum number of notebook sessions to return.

  • :next_token (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:

See Also:



2269
2270
2271
2272
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2269

def list_notebook_sessions(params = {}, options = {})
  req = build_request(:list_notebook_sessions, params)
  req.send_request(options)
end

#list_prepared_statements(params = {}) ⇒ Types::ListPreparedStatementsOutput

Lists the prepared statements in the specified workgroup.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_prepared_statements({
  work_group: "WorkGroupName", # required
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.prepared_statements #=> Array
resp.prepared_statements[0].statement_name #=> String
resp.prepared_statements[0].last_modified_time #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The workgroup to list the prepared statements for.

  • :next_token (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.

  • :max_results (Integer)

    The maximum number of results to return in this request.

Returns:

See Also:



2314
2315
2316
2317
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2314

def list_prepared_statements(params = {}, options = {})
  req = build_request(:list_prepared_statements, params)
  req.send_request(options)
end

#list_query_executions(params = {}) ⇒ Types::ListQueryExecutionsOutput

Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_query_executions({
  next_token: "Token",
  max_results: 1,
  work_group: "WorkGroupName",
})

Response structure


resp.query_execution_ids #=> Array
resp.query_execution_ids[0] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (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.

  • :max_results (Integer)

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

  • :work_group (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.

Returns:

See Also:



2370
2371
2372
2373
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2370

def list_query_executions(params = {}, options = {})
  req = build_request(:list_query_executions, params)
  req.send_request(options)
end

#list_sessions(params = {}) ⇒ Types::ListSessionsResponse

Lists the sessions in a workgroup that are in an active state like CREATING, CREATED, IDLE, or BUSY. Newer sessions are listed first; older sessions are listed later.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_sessions({
  work_group: "WorkGroupName", # required
  state_filter: "CREATING", # accepts CREATING, CREATED, IDLE, BUSY, TERMINATING, TERMINATED, DEGRADED, FAILED
  max_results: 1,
  next_token: "SessionManagerToken",
})

Response structure


resp.next_token #=> String
resp.sessions #=> Array
resp.sessions[0].session_id #=> String
resp.sessions[0].description #=> String
resp.sessions[0].engine_version.selected_engine_version #=> String
resp.sessions[0].engine_version.effective_engine_version #=> String
resp.sessions[0].notebook_version #=> String
resp.sessions[0].status.start_date_time #=> Time
resp.sessions[0].status.last_modified_date_time #=> Time
resp.sessions[0].status.end_date_time #=> Time
resp.sessions[0].status.idle_since_date_time #=> Time
resp.sessions[0].status.state #=> String, one of "CREATING", "CREATED", "IDLE", "BUSY", "TERMINATING", "TERMINATED", "DEGRADED", "FAILED"
resp.sessions[0].status.state_change_reason #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The workgroup to which the session belongs.

  • :state_filter (String)

    A filter for a specific session state. A description of each state follows.

    CREATING - The session is being started, including acquiring resources.

    CREATED - The session has been started.

    IDLE - The session is able to accept a calculation.

    BUSY - The session is processing another task and is unable to accept a calculation.

    TERMINATING - The session is in the process of shutting down.

    TERMINATED - The session and its resources are no longer running.

    DEGRADED - The session has no healthy coordinators.

    FAILED - Due to a failure, the session and its resources are no longer running.

  • :max_results (Integer)

    The maximum number of sessions to return.

  • :next_token (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:

See Also:



2450
2451
2452
2453
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2450

def list_sessions(params = {}, options = {})
  req = build_request(:list_sessions, params)
  req.send_request(options)
end

#list_table_metadata(params = {}) ⇒ Types::ListTableMetadataOutput

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.({
  catalog_name: "CatalogNameString", # required
  database_name: "NameString", # required
  expression: "ExpressionString",
  next_token: "Token",
  max_results: 1,
})

Response structure


resp. #=> Array
resp.[0].name #=> String
resp.[0].create_time #=> Time
resp.[0].last_access_time #=> Time
resp.[0].table_type #=> String
resp.[0].columns #=> Array
resp.[0].columns[0].name #=> String
resp.[0].columns[0].type #=> String
resp.[0].columns[0].comment #=> String
resp.[0].partition_keys #=> Array
resp.[0].partition_keys[0].name #=> String
resp.[0].partition_keys[0].type #=> String
resp.[0].partition_keys[0].comment #=> String
resp.[0].parameters #=> Hash
resp.[0].parameters["KeyString"] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :catalog_name (required, String)

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

  • :database_name (required, 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.

  • :next_token (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.

  • :max_results (Integer)

    Specifies the maximum number of results to return.

Returns:

See Also:



2518
2519
2520
2521
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2518

def (params = {}, options = {})
  req = build_request(:list_table_metadata, params)
  req.send_request(options)
end

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "AmazonResourceName", # required
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    Lists the tags for the resource with the specified ARN.

  • :next_token (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.

  • :max_results (Integer)

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

Returns:

See Also:



2564
2565
2566
2567
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2564

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

#list_work_groups(params = {}) ⇒ Types::ListWorkGroupsOutput

Lists available workgroups for the account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_work_groups({
  next_token: "Token",
  max_results: 1,
})

Response structure


resp.work_groups #=> Array
resp.work_groups[0].name #=> String
resp.work_groups[0].state #=> String, one of "ENABLED", "DISABLED"
resp.work_groups[0].description #=> String
resp.work_groups[0].creation_time #=> Time
resp.work_groups[0].engine_version.selected_engine_version #=> String
resp.work_groups[0].engine_version.effective_engine_version #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (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.

  • :max_results (Integer)

    The maximum number of workgroups to return in this request.

Returns:

See Also:



2609
2610
2611
2612
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2609

def list_work_groups(params = {}, options = {})
  req = build_request(:list_work_groups, params)
  req.send_request(options)
end

#start_calculation_execution(params = {}) ⇒ Types::StartCalculationExecutionResponse

Submits calculations for execution within a session. You can supply the code to run as an inline code block within the request.

Examples:

Request syntax with placeholder values


resp = client.start_calculation_execution({
  session_id: "SessionId", # required
  description: "DescriptionString",
  calculation_configuration: {
    code_block: "CodeBlock",
  },
  code_block: "CodeBlock",
  client_request_token: "IdempotencyToken",
})

Response structure


resp.calculation_execution_id #=> String
resp.state #=> String, one of "CREATING", "CREATED", "QUEUED", "RUNNING", "CANCELING", "CANCELED", "COMPLETED", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

  • :description (String)

    A description of the calculation.

  • :calculation_configuration (Types::CalculationConfiguration)

    Contains configuration information for the calculation.

  • :code_block (String)

    A string that contains the code of the calculation.

  • :client_request_token (String)

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

Returns:

See Also:



2668
2669
2670
2671
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2668

def start_calculation_execution(params = {}, options = {})
  req = build_request(:start_calculation_execution, params)
  req.send_request(options)
end

#start_query_execution(params = {}) ⇒ Types::StartQueryExecutionOutput

Runs the SQL query statements contained in the Query. Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires GetDataCatalog permission to the catalog. For code samples using the Amazon Web Services SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.

Examples:

Request syntax with placeholder values


resp = client.start_query_execution({
  query_string: "QueryString", # required
  client_request_token: "IdempotencyToken",
  query_execution_context: {
    database: "DatabaseString",
    catalog: "CatalogNameString",
  },
  result_configuration: {
    output_location: "ResultOutputLocation",
    encryption_configuration: {
      encryption_option: "SSE_S3", # required, accepts SSE_S3, SSE_KMS, CSE_KMS
      kms_key: "String",
    },
    expected_bucket_owner: "AwsAccountId",
    acl_configuration: {
      s3_acl_option: "BUCKET_OWNER_FULL_CONTROL", # required, accepts BUCKET_OWNER_FULL_CONTROL
    },
  },
  work_group: "WorkGroupName",
  execution_parameters: ["ExecutionParameter"],
  result_reuse_configuration: {
    result_reuse_by_age_configuration: {
      enabled: false, # required
      max_age_in_minutes: 1,
    },
  },
})

Response structure


resp.query_execution_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_string (required, String)

    The SQL query statements to be executed.

  • :client_request_token (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.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :query_execution_context (Types::QueryExecutionContext)

    The database within which the query executes.

  • :result_configuration (Types::ResultConfiguration)

    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.

  • :work_group (String)

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

  • :execution_parameters (Array<String>)

    A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.

  • :result_reuse_configuration (Types::ResultReuseConfiguration)

    Specifies the query result reuse behavior for the query.

Returns:

See Also:



2768
2769
2770
2771
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2768

def start_query_execution(params = {}, options = {})
  req = build_request(:start_query_execution, params)
  req.send_request(options)
end

#start_session(params = {}) ⇒ Types::StartSessionResponse

Creates a session for running calculations within a workgroup. The session is ready when it reaches an IDLE state.

Examples:

Request syntax with placeholder values


resp = client.start_session({
  description: "DescriptionString",
  work_group: "WorkGroupName", # required
  engine_configuration: { # required
    coordinator_dpu_size: 1,
    max_concurrent_dpus: 1, # required
    default_executor_dpu_size: 1,
    additional_configs: {
      "KeyString" => "ParametersMapValue",
    },
  },
  notebook_version: "NameString",
  session_idle_timeout_in_minutes: 1,
  client_request_token: "IdempotencyToken",
})

Response structure


resp.session_id #=> String
resp.state #=> String, one of "CREATING", "CREATED", "IDLE", "BUSY", "TERMINATING", "TERMINATED", "DEGRADED", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :description (String)

    The session description.

  • :work_group (required, String)

    The workgroup to which the session belongs.

  • :engine_configuration (required, Types::EngineConfiguration)

    Contains engine data processing unit (DPU) configuration settings and parameter mappings.

  • :notebook_version (String)

    The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is Athena notebook version 1. If you specify a value for NotebookVersion, you must also specify a value for NotebookId. See EngineConfiguration$AdditionalConfigs.

  • :session_idle_timeout_in_minutes (Integer)

    The idle timeout in minutes for the session.

  • :client_request_token (String)

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

Returns:

See Also:



2842
2843
2844
2845
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2842

def start_session(params = {}, options = {})
  req = build_request(:start_session, params)
  req.send_request(options)
end

#stop_calculation_execution(params = {}) ⇒ Types::StopCalculationExecutionResponse

Requests the cancellation of a calculation. A StopCalculationExecution call on a calculation that is already in a terminal state (for example, STOPPED, FAILED, or COMPLETED) succeeds but has no effect.

Cancelling a calculation is done on a best effort basis. If a calculation cannot be cancelled, you can be charged for its completion. If you are concerned about being charged for a calculation that cannot be cancelled, consider terminating the session in which the calculation is running.

Examples:

Request syntax with placeholder values


resp = client.stop_calculation_execution({
  calculation_execution_id: "CalculationExecutionId", # required
})

Response structure


resp.state #=> String, one of "CREATING", "CREATED", "QUEUED", "RUNNING", "CANCELING", "CANCELED", "COMPLETED", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :calculation_execution_id (required, String)

    The calculation execution UUID.

Returns:

See Also:



2881
2882
2883
2884
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2881

def stop_calculation_execution(params = {}, options = {})
  req = build_request(:stop_calculation_execution, params)
  req.send_request(options)
end

#stop_query_execution(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.stop_query_execution({
  query_execution_id: "QueryExecutionId", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :query_execution_id (required, String)

    The unique ID of the query execution to stop.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2914
2915
2916
2917
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2914

def stop_query_execution(params = {}, options = {})
  req = build_request(:stop_query_execution, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "AmazonResourceName", # required
  tags: [ # required
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

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

  • :tags (required, Array<Types::Tag>)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2963
2964
2965
2966
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2963

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#terminate_session(params = {}) ⇒ Types::TerminateSessionResponse

Terminates an active session. A TerminateSession call on a session that is already inactive (for example, in a FAILED, TERMINATED or TERMINATING state) succeeds but has no effect. Calculations running in the session when TerminateSession is called are forcefully stopped, but may display as FAILED instead of STOPPED.

Examples:

Request syntax with placeholder values


resp = client.terminate_session({
  session_id: "SessionId", # required
})

Response structure


resp.state #=> String, one of "CREATING", "CREATED", "IDLE", "BUSY", "TERMINATING", "TERMINATED", "DEGRADED", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :session_id (required, String)

    The session ID.

Returns:

See Also:



2995
2996
2997
2998
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2995

def terminate_session(params = {}, options = {})
  req = build_request(:terminate_session, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ Struct

Removes one or more tags from a data catalog or workgroup resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "AmazonResourceName", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

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

  • :tag_keys (required, Array<String>)

    A comma-separated list of one or more tag keys whose tags are to be removed from the specified resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3022
3023
3024
3025
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3022

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#update_data_catalog(params = {}) ⇒ Struct

Updates the data catalog that has the specified name.

Examples:

Request syntax with placeholder values


resp = client.update_data_catalog({
  name: "CatalogNameString", # required
  type: "LAMBDA", # required, accepts LAMBDA, GLUE, HIVE
  description: "DescriptionString",
  parameters: {
    "KeyString" => "ParametersMapValue",
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, 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 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.

  • :type (required, 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.

  • :description (String)

    New or modified text that describes the data catalog.

  • :parameters (Hash<String,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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3088
3089
3090
3091
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3088

def update_data_catalog(params = {}, options = {})
  req = build_request(:update_data_catalog, params)
  req.send_request(options)
end

#update_named_query(params = {}) ⇒ Struct

Updates a NamedQuery object. The database or workgroup cannot be updated.

Examples:

Request syntax with placeholder values


resp = client.update_named_query({
  named_query_id: "NamedQueryId", # required
  name: "NameString", # required
  description: "NamedQueryDescriptionString",
  query_string: "QueryString", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :named_query_id (required, String)

    The unique identifier (UUID) of the query.

  • :name (required, String)

    The name of the query.

  • :description (String)

    The query description.

  • :query_string (required, String)

    The contents of the query with all query statements.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3123
3124
3125
3126
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3123

def update_named_query(params = {}, options = {})
  req = build_request(:update_named_query, params)
  req.send_request(options)
end

#update_notebook(params = {}) ⇒ Struct

Updates the contents of a Spark notebook.

Examples:

Request syntax with placeholder values


resp = client.update_notebook({
  notebook_id: "NotebookId", # required
  payload: "Payload", # required
  type: "IPYNB", # required, accepts IPYNB
  session_id: "SessionId",
  client_request_token: "ClientRequestToken",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook to update.

  • :payload (required, String)

    The updated content for the notebook.

  • :type (required, String)

    The notebook content type. Currently, the only valid type is IPYNB.

  • :session_id (String)

    The active notebook session ID. Required if the notebook has an active session.

  • :client_request_token (String)

    A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3169
3170
3171
3172
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3169

def update_notebook(params = {}, options = {})
  req = build_request(:update_notebook, params)
  req.send_request(options)
end

#update_notebook_metadata(params = {}) ⇒ Struct

Updates the metadata for a notebook.

Examples:

Request syntax with placeholder values


resp = client.({
  notebook_id: "NotebookId", # required
  client_request_token: "ClientRequestToken",
  name: "NotebookName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :notebook_id (required, String)

    The ID of the notebook to update the metadata for.

  • :client_request_token (String)

    A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).

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

  • :name (required, String)

    The name to update the notebook to.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3206
3207
3208
3209
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3206

def (params = {}, options = {})
  req = build_request(:update_notebook_metadata, params)
  req.send_request(options)
end

#update_prepared_statement(params = {}) ⇒ Struct

Updates a prepared statement.

Examples:

Request syntax with placeholder values


resp = client.update_prepared_statement({
  statement_name: "StatementName", # required
  work_group: "WorkGroupName", # required
  query_statement: "QueryString", # required
  description: "DescriptionString",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :statement_name (required, String)

    The name of the prepared statement.

  • :work_group (required, String)

    The workgroup for the prepared statement.

  • :query_statement (required, String)

    The query string for the prepared statement.

  • :description (String)

    The description of the prepared statement.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3240
3241
3242
3243
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3240

def update_prepared_statement(params = {}, options = {})
  req = build_request(:update_prepared_statement, params)
  req.send_request(options)
end

#update_work_group(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.update_work_group({
  work_group: "WorkGroupName", # required
  description: "WorkGroupDescriptionString",
  configuration_updates: {
    enforce_work_group_configuration: false,
    result_configuration_updates: {
      output_location: "ResultOutputLocation",
      remove_output_location: false,
      encryption_configuration: {
        encryption_option: "SSE_S3", # required, accepts SSE_S3, SSE_KMS, CSE_KMS
        kms_key: "String",
      },
      remove_encryption_configuration: false,
      expected_bucket_owner: "AwsAccountId",
      remove_expected_bucket_owner: false,
      acl_configuration: {
        s3_acl_option: "BUCKET_OWNER_FULL_CONTROL", # required, accepts BUCKET_OWNER_FULL_CONTROL
      },
      remove_acl_configuration: false,
    },
    publish_cloud_watch_metrics_enabled: false,
    bytes_scanned_cutoff_per_query: 1,
    remove_bytes_scanned_cutoff_per_query: false,
    requester_pays_enabled: false,
    engine_version: {
      selected_engine_version: "NameString",
      effective_engine_version: "NameString",
    },
    remove_customer_content_encryption_configuration: false,
    additional_configuration: "NameString",
    execution_role: "RoleArn",
    customer_content_encryption_configuration: {
      kms_key: "KmsKey", # required
    },
    enable_minimum_encryption_configuration: false,
  },
  state: "ENABLED", # accepts ENABLED, DISABLED
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :work_group (required, String)

    The specified workgroup that will be updated.

  • :description (String)

    The workgroup description.

  • :configuration_updates (Types::WorkGroupConfigurationUpdates)

    Contains configuration updates for an Athena SQL workgroup.

  • :state (String)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3307
3308
3309
3310
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 3307

def update_work_group(params = {}, options = {})
  req = build_request(:update_work_group, params)
  req.send_request(options)
end