Class: Aws::Athena::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Athena::Client
- 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
API Operations collapse
-
#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.
-
#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.
-
#create_data_catalog(params = {}) ⇒ Struct
Creates (registers) a data catalog with the specified name and properties.
-
#create_named_query(params = {}) ⇒ Types::CreateNamedQueryOutput
Creates a named query in the specified workgroup.
-
#create_prepared_statement(params = {}) ⇒ Struct
Creates a prepared statement for use with SQL queries in Athena.
-
#create_work_group(params = {}) ⇒ Struct
Creates a workgroup with the specified name.
-
#delete_data_catalog(params = {}) ⇒ Struct
Deletes a data catalog.
-
#delete_named_query(params = {}) ⇒ Struct
Deletes the named query if you have access to the workgroup in which the query was saved.
-
#delete_prepared_statement(params = {}) ⇒ Struct
Deletes the prepared statement with the specified name from the specified workgroup.
-
#delete_work_group(params = {}) ⇒ Struct
Deletes the workgroup with the specified name.
-
#get_data_catalog(params = {}) ⇒ Types::GetDataCatalogOutput
Returns the specified data catalog.
-
#get_database(params = {}) ⇒ Types::GetDatabaseOutput
Returns a database object for the specified database and data catalog.
-
#get_named_query(params = {}) ⇒ Types::GetNamedQueryOutput
Returns information about a single query.
-
#get_prepared_statement(params = {}) ⇒ Types::GetPreparedStatementOutput
Retrieves the prepared statement with the specified name from the specified workgroup.
-
#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.
-
#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. -
#get_table_metadata(params = {}) ⇒ Types::GetTableMetadataOutput
Returns table metadata for the specified catalog, database, and table.
-
#get_work_group(params = {}) ⇒ Types::GetWorkGroupOutput
Returns information about the workgroup with the specified name.
-
#list_data_catalogs(params = {}) ⇒ Types::ListDataCatalogsOutput
Lists the data catalogs in the current Amazon Web Services account.
-
#list_databases(params = {}) ⇒ Types::ListDatabasesOutput
Lists the databases in the specified data catalog.
-
#list_engine_versions(params = {}) ⇒ Types::ListEngineVersionsOutput
Returns a list of engine versions that are available to choose from, including the Auto option.
-
#list_named_queries(params = {}) ⇒ Types::ListNamedQueriesOutput
Provides a list of available query IDs only for queries saved in the specified workgroup.
-
#list_prepared_statements(params = {}) ⇒ Types::ListPreparedStatementsOutput
Lists the prepared statements in the specfied workgroup.
-
#list_query_executions(params = {}) ⇒ Types::ListQueryExecutionsOutput
Provides a list of available query execution IDs for the queries in the specified workgroup.
-
#list_table_metadata(params = {}) ⇒ Types::ListTableMetadataOutput
Lists the metadata for the tables in the specified data catalog database.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput
Lists the tags associated with an Athena workgroup or data catalog resource.
-
#list_work_groups(params = {}) ⇒ Types::ListWorkGroupsOutput
Lists available workgroups for the account.
-
#start_query_execution(params = {}) ⇒ Types::StartQueryExecutionOutput
Runs the SQL query statements contained in the
Query
. -
#stop_query_execution(params = {}) ⇒ Struct
Stops a query execution.
-
#tag_resource(params = {}) ⇒ Struct
Adds one or more tags to an Athena resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from a data catalog or workgroup resource.
-
#update_data_catalog(params = {}) ⇒ Struct
Updates the data catalog that has the specified name.
-
#update_named_query(params = {}) ⇒ Struct
Updates a NamedQuery object.
-
#update_prepared_statement(params = {}) ⇒ Struct
Updates a prepared statement.
-
#update_work_group(params = {}) ⇒ Struct
Updates the workgroup with the specified name.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
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.
358 359 360 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 358 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.
407 408 409 410 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 407 def batch_get_named_query(params = {}, = {}) req = build_request(:batch_get_named_query, params) req.send_request() 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.
474 475 476 477 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 474 def batch_get_query_execution(params = {}, = {}) req = build_request(:batch_get_query_execution, params) req.send_request() 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.
569 570 571 572 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 569 def create_data_catalog(params = {}, = {}) req = build_request(:create_data_catalog, params) req.send_request() 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.
638 639 640 641 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 638 def create_named_query(params = {}, = {}) req = build_request(:create_named_query, params) req.send_request() end |
#create_prepared_statement(params = {}) ⇒ Struct
Creates a prepared statement for use with SQL queries in Athena.
672 673 674 675 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 672 def create_prepared_statement(params = {}, = {}) req = build_request(:create_prepared_statement, params) req.send_request() end |
#create_work_group(params = {}) ⇒ Struct
Creates a workgroup with the specified name.
740 741 742 743 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 740 def create_work_group(params = {}, = {}) req = build_request(:create_work_group, params) req.send_request() end |
#delete_data_catalog(params = {}) ⇒ Struct
Deletes a data catalog.
762 763 764 765 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 762 def delete_data_catalog(params = {}, = {}) req = build_request(:delete_data_catalog, params) req.send_request() 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.
795 796 797 798 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 795 def delete_named_query(params = {}, = {}) req = build_request(:delete_named_query, params) req.send_request() end |
#delete_prepared_statement(params = {}) ⇒ Struct
Deletes the prepared statement with the specified name from the specified workgroup.
822 823 824 825 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 822 def delete_prepared_statement(params = {}, = {}) req = build_request(:delete_prepared_statement, params) req.send_request() end |
#delete_work_group(params = {}) ⇒ Struct
Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.
850 851 852 853 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 850 def delete_work_group(params = {}, = {}) req = build_request(:delete_work_group, params) req.send_request() end |
#get_data_catalog(params = {}) ⇒ Types::GetDataCatalogOutput
Returns the specified data catalog.
882 883 884 885 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 882 def get_data_catalog(params = {}, = {}) req = build_request(:get_data_catalog, params) req.send_request() end |
#get_database(params = {}) ⇒ Types::GetDatabaseOutput
Returns a database object for the specified database and data catalog.
917 918 919 920 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 917 def get_database(params = {}, = {}) req = build_request(:get_database, params) req.send_request() 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.
951 952 953 954 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 951 def get_named_query(params = {}, = {}) req = build_request(:get_named_query, params) req.send_request() end |
#get_prepared_statement(params = {}) ⇒ Types::GetPreparedStatementOutput
Retrieves the prepared statement with the specified name from the specified workgroup.
988 989 990 991 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 988 def get_prepared_statement(params = {}, = {}) req = build_request(:get_prepared_statement, params) req.send_request() 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.
1046 1047 1048 1049 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1046 def get_query_execution(params = {}, = {}) req = build_request(:get_query_execution, params) req.send_request() 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 Query Results in the Amazon Athena
User Guide. This request does not execute the query but returns
results. Use StartQueryExecution to run a query.
To stream query results successfully, the IAM principal with
permission to call GetQueryResults
also must have permissions to the
Amazon S3 GetObject
action for the Athena query results location.
IAM principals with permission to the Amazon S3 GetObject
action for
the query results location are able to retrieve query results from
Amazon S3 even if permission to the GetQueryResults
action is
denied. To restrict user or role access, ensure that Amazon S3
permissions to the Athena query location are denied.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1122 1123 1124 1125 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1122 def get_query_results(params = {}, = {}) req = build_request(:get_query_results, params) req.send_request() end |
#get_table_metadata(params = {}) ⇒ Types::GetTableMetadataOutput
Returns table metadata for the specified catalog, database, and table.
1172 1173 1174 1175 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1172 def (params = {}, = {}) req = build_request(:get_table_metadata, params) req.send_request() end |
#get_work_group(params = {}) ⇒ Types::GetWorkGroupOutput
Returns information about the workgroup with the specified name.
1214 1215 1216 1217 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1214 def get_work_group(params = {}, = {}) req = build_request(:get_work_group, params) req.send_request() end |
#list_data_catalogs(params = {}) ⇒ Types::ListDataCatalogsOutput
Lists the data catalogs in the current Amazon Web Services account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1255 1256 1257 1258 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1255 def list_data_catalogs(params = {}, = {}) req = build_request(:list_data_catalogs, params) req.send_request() 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.
1302 1303 1304 1305 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1302 def list_databases(params = {}, = {}) req = build_request(:list_databases, params) req.send_request() end |
#list_engine_versions(params = {}) ⇒ Types::ListEngineVersionsOutput
Returns a list of engine versions that are available to choose from, including the Auto option.
1342 1343 1344 1345 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1342 def list_engine_versions(params = {}, = {}) req = build_request(:list_engine_versions, params) req.send_request() 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.
1398 1399 1400 1401 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1398 def list_named_queries(params = {}, = {}) req = build_request(:list_named_queries, params) req.send_request() end |
#list_prepared_statements(params = {}) ⇒ Types::ListPreparedStatementsOutput
Lists the prepared statements in the specfied workgroup.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1443 1444 1445 1446 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1443 def list_prepared_statements(params = {}, = {}) req = build_request(:list_prepared_statements, params) req.send_request() 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.
1499 1500 1501 1502 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1499 def list_query_executions(params = {}, = {}) req = build_request(:list_query_executions, params) req.send_request() 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.
1567 1568 1569 1570 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1567 def (params = {}, = {}) req = build_request(:list_table_metadata, params) req.send_request() 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.
1613 1614 1615 1616 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1613 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() 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.
1658 1659 1660 1661 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1658 def list_work_groups(params = {}, = {}) req = build_request(:list_work_groups, params) req.send_request() 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.
1743 1744 1745 1746 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1743 def start_query_execution(params = {}, = {}) req = build_request(:start_query_execution, params) req.send_request() 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.
1776 1777 1778 1779 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1776 def stop_query_execution(params = {}, = {}) req = build_request(:stop_query_execution, params) req.send_request() 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.
1825 1826 1827 1828 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1825 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from a data catalog or workgroup resource.
1852 1853 1854 1855 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1852 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_data_catalog(params = {}) ⇒ Struct
Updates the data catalog that has the specified name.
1918 1919 1920 1921 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1918 def update_data_catalog(params = {}, = {}) req = build_request(:update_data_catalog, params) req.send_request() end |
#update_named_query(params = {}) ⇒ Struct
Updates a NamedQuery object. The database or workgroup cannot be updated.
1953 1954 1955 1956 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1953 def update_named_query(params = {}, = {}) req = build_request(:update_named_query, params) req.send_request() end |
#update_prepared_statement(params = {}) ⇒ Struct
Updates a prepared statement.
1987 1988 1989 1990 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1987 def update_prepared_statement(params = {}, = {}) req = build_request(:update_prepared_statement, params) req.send_request() end |
#update_work_group(params = {}) ⇒ Struct
Updates the workgroup with the specified name. The workgroup's name cannot be changed.
2048 2049 2050 2051 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 2048 def update_work_group(params = {}, = {}) req = build_request(:update_work_group, params) req.send_request() end |