Interface RedshiftDataAsyncClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.The asynchronous client performs non-blocking I/O when configured with any
SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may
perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API
call.
You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You can run SQL statements, which are committed if the statement succeeds.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionbatchExecuteStatement(Consumer<BatchExecuteStatementRequest.Builder> batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).batchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).builder()Create a builder that can be used to configure and create aRedshiftDataAsyncClient.default CompletableFuture<CancelStatementResponse> cancelStatement(Consumer<CancelStatementRequest.Builder> cancelStatementRequest) Cancels a running query.default CompletableFuture<CancelStatementResponse> cancelStatement(CancelStatementRequest cancelStatementRequest) Cancels a running query.static RedshiftDataAsyncClientcreate()Create aRedshiftDataAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.describeStatement(Consumer<DescribeStatementRequest.Builder> describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API.describeStatement(DescribeStatementRequest describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API.default CompletableFuture<DescribeTableResponse> describeTable(Consumer<DescribeTableRequest.Builder> describeTableRequest) Describes the detailed information about a table from metadata in the cluster.default CompletableFuture<DescribeTableResponse> describeTable(DescribeTableRequest describeTableRequest) Describes the detailed information about a table from metadata in the cluster.default DescribeTablePublisherdescribeTablePaginator(Consumer<DescribeTableRequest.Builder> describeTableRequest) This is a variant ofdescribeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.default DescribeTablePublisherdescribeTablePaginator(DescribeTableRequest describeTableRequest) This is a variant ofdescribeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.executeStatement(Consumer<ExecuteStatementRequest.Builder> executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL).executeStatement(ExecuteStatementRequest executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL).getStatementResult(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) Fetches the temporarily cached result of an SQL statement.getStatementResult(GetStatementResultRequest getStatementResultRequest) Fetches the temporarily cached result of an SQL statement.default GetStatementResultPublishergetStatementResultPaginator(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) This is a variant ofgetStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.default GetStatementResultPublishergetStatementResultPaginator(GetStatementResultRequest getStatementResultRequest) This is a variant ofgetStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.default CompletableFuture<ListDatabasesResponse> listDatabases(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) List the databases in a cluster.default CompletableFuture<ListDatabasesResponse> listDatabases(ListDatabasesRequest listDatabasesRequest) List the databases in a cluster.default ListDatabasesPublisherlistDatabasesPaginator(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) This is a variant oflistDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.default ListDatabasesPublisherlistDatabasesPaginator(ListDatabasesRequest listDatabasesRequest) This is a variant oflistDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.default CompletableFuture<ListSchemasResponse> listSchemas(Consumer<ListSchemasRequest.Builder> listSchemasRequest) Lists the schemas in a database.default CompletableFuture<ListSchemasResponse> listSchemas(ListSchemasRequest listSchemasRequest) Lists the schemas in a database.default ListSchemasPublisherlistSchemasPaginator(Consumer<ListSchemasRequest.Builder> listSchemasRequest) This is a variant oflistSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.default ListSchemasPublisherlistSchemasPaginator(ListSchemasRequest listSchemasRequest) This is a variant oflistSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.default CompletableFuture<ListStatementsResponse> listStatements(Consumer<ListStatementsRequest.Builder> listStatementsRequest) List of SQL statements.default CompletableFuture<ListStatementsResponse> listStatements(ListStatementsRequest listStatementsRequest) List of SQL statements.default ListStatementsPublisherlistStatementsPaginator(Consumer<ListStatementsRequest.Builder> listStatementsRequest) This is a variant oflistStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.default ListStatementsPublisherlistStatementsPaginator(ListStatementsRequest listStatementsRequest) This is a variant oflistStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.default CompletableFuture<ListTablesResponse> listTables(Consumer<ListTablesRequest.Builder> listTablesRequest) List the tables in a database.default CompletableFuture<ListTablesResponse> listTables(ListTablesRequest listTablesRequest) List the tables in a database.default ListTablesPublisherlistTablesPaginator(Consumer<ListTablesRequest.Builder> listTablesRequest) This is a variant oflistTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation.default ListTablesPublisherlistTablesPaginator(ListTablesRequest listTablesRequest) This is a variant oflistTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
batchExecuteStatement
default CompletableFuture<BatchExecuteStatementResponse> batchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL). Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
batchExecuteStatementRequest-- Returns:
- A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ActiveSessionsExceededException The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.
- ActiveStatementsExceededException The number of active statements exceeds the limit.
- BatchExecuteStatementException An SQL statement encountered an environmental error while running.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
batchExecuteStatement
default CompletableFuture<BatchExecuteStatementResponse> batchExecuteStatement(Consumer<BatchExecuteStatementRequest.Builder> batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL). Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
BatchExecuteStatementRequest.Builderavoiding the need to create one manually viaBatchExecuteStatementRequest.builder()- Parameters:
batchExecuteStatementRequest- AConsumerthat will call methods onBatchExecuteStatementRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ActiveSessionsExceededException The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.
- ActiveStatementsExceededException The number of active statements exceeds the limit.
- BatchExecuteStatementException An SQL statement encountered an environmental error while running.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
cancelStatement
default CompletableFuture<CancelStatementResponse> cancelStatement(CancelStatementRequest cancelStatementRequest) Cancels a running query. To be canceled, a query must be running.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
cancelStatementRequest-- Returns:
- A Java Future containing the result of the CancelStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
cancelStatement
default CompletableFuture<CancelStatementResponse> cancelStatement(Consumer<CancelStatementRequest.Builder> cancelStatementRequest) Cancels a running query. To be canceled, a query must be running.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
CancelStatementRequest.Builderavoiding the need to create one manually viaCancelStatementRequest.builder()- Parameters:
cancelStatementRequest- AConsumerthat will call methods onCancelStatementRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the CancelStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeStatement
default CompletableFuture<DescribeStatementResponse> describeStatement(DescribeStatementRequest describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
describeStatementRequest-- Returns:
- A Java Future containing the result of the DescribeStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeStatement
default CompletableFuture<DescribeStatementResponse> describeStatement(Consumer<DescribeStatementRequest.Builder> describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
DescribeStatementRequest.Builderavoiding the need to create one manually viaDescribeStatementRequest.builder()- Parameters:
describeStatementRequest- AConsumerthat will call methods onDescribeStatementRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the DescribeStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeTable
default CompletableFuture<DescribeTableResponse> describeTable(DescribeTableRequest describeTableRequest) Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
describeTableRequest-- Returns:
- A Java Future containing the result of the DescribeTable operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
describeTable
default CompletableFuture<DescribeTableResponse> describeTable(Consumer<DescribeTableRequest.Builder> describeTableRequest) Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
DescribeTableRequest.Builderavoiding the need to create one manually viaDescribeTableRequest.builder()- Parameters:
describeTableRequest- AConsumerthat will call methods onDescribeTableRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the DescribeTable operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
describeTablePaginator
This is a variant of
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTablePublisher publisher = client.describeTablePaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.DescribeTablePublisher publisher = client.describeTablePaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.- Parameters:
describeTableRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeTablePaginator
default DescribeTablePublisher describeTablePaginator(Consumer<DescribeTableRequest.Builder> describeTableRequest) This is a variant of
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTablePublisher publisher = client.describeTablePaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.DescribeTablePublisher publisher = client.describeTablePaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.
This is a convenience which creates an instance of the
DescribeTableRequest.Builderavoiding the need to create one manually viaDescribeTableRequest.builder()- Parameters:
describeTableRequest- AConsumerthat will call methods onDescribeTableRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
executeStatement
default CompletableFuture<ExecuteStatementResponse> executeStatement(ExecuteStatementRequest executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
executeStatementRequest-- Returns:
- A Java Future containing the result of the ExecuteStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ActiveSessionsExceededException The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.
- ExecuteStatementException The SQL statement encountered an environmental error while running.
- ActiveStatementsExceededException The number of active statements exceeds the limit.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
executeStatement
default CompletableFuture<ExecuteStatementResponse> executeStatement(Consumer<ExecuteStatementRequest.Builder> executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
ExecuteStatementRequest.Builderavoiding the need to create one manually viaExecuteStatementRequest.builder()- Parameters:
executeStatementRequest- AConsumerthat will call methods onExecuteStatementRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ExecuteStatement operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ActiveSessionsExceededException The Amazon Redshift Data API operation failed because the maximum number of active sessions exceeded.
- ExecuteStatementException The SQL statement encountered an environmental error while running.
- ActiveStatementsExceededException The number of active statements exceeds the limit.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
getStatementResult
default CompletableFuture<GetStatementResultResponse> getStatementResult(GetStatementResultRequest getStatementResultRequest) Fetches the temporarily cached result of an SQL statement. A token is returned to page through the statement results.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
getStatementResultRequest-- Returns:
- A Java Future containing the result of the GetStatementResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getStatementResult
default CompletableFuture<GetStatementResultResponse> getStatementResult(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) Fetches the temporarily cached result of an SQL statement. A token is returned to page through the statement results.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
GetStatementResultRequest.Builderavoiding the need to create one manually viaGetStatementResultRequest.builder()- Parameters:
getStatementResultRequest- AConsumerthat will call methods onGetStatementResultRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the GetStatementResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getStatementResultPaginator
default GetStatementResultPublisher getStatementResultPaginator(GetStatementResultRequest getStatementResultRequest) This is a variant of
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultPublisher publisher = client.getStatementResultPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultPublisher publisher = client.getStatementResultPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse response) { //... }; });Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.- Parameters:
getStatementResultRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getStatementResultPaginator
default GetStatementResultPublisher getStatementResultPaginator(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) This is a variant of
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultPublisher publisher = client.getStatementResultPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultPublisher publisher = client.getStatementResultPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse response) { //... }; });Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.
This is a convenience which creates an instance of the
GetStatementResultRequest.Builderavoiding the need to create one manually viaGetStatementResultRequest.builder()- Parameters:
getStatementResultRequest- AConsumerthat will call methods onGetStatementResultRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- ResourceNotFoundException The Amazon Redshift Data API operation failed due to a missing resource.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listDatabases
default CompletableFuture<ListDatabasesResponse> listDatabases(ListDatabasesRequest listDatabasesRequest) List the databases in a cluster. A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
listDatabasesRequest-- Returns:
- A Java Future containing the result of the ListDatabases operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listDatabases
default CompletableFuture<ListDatabasesResponse> listDatabases(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) List the databases in a cluster. A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
ListDatabasesRequest.Builderavoiding the need to create one manually viaListDatabasesRequest.builder()- Parameters:
listDatabasesRequest- AConsumerthat will call methods onListDatabasesRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ListDatabases operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listDatabasesPaginator
This is a variant of
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesPublisher publisher = client.listDatabasesPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesPublisher publisher = client.listDatabasesPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.- Parameters:
listDatabasesRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listDatabasesPaginator
default ListDatabasesPublisher listDatabasesPaginator(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) This is a variant of
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesPublisher publisher = client.listDatabasesPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesPublisher publisher = client.listDatabasesPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.
This is a convenience which creates an instance of the
ListDatabasesRequest.Builderavoiding the need to create one manually viaListDatabasesRequest.builder()- Parameters:
listDatabasesRequest- AConsumerthat will call methods onListDatabasesRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSchemas
Lists the schemas in a database. A token is returned to page through the schema list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
listSchemasRequest-- Returns:
- A Java Future containing the result of the ListSchemas operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listSchemas
default CompletableFuture<ListSchemasResponse> listSchemas(Consumer<ListSchemasRequest.Builder> listSchemasRequest) Lists the schemas in a database. A token is returned to page through the schema list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
ListSchemasRequest.Builderavoiding the need to create one manually viaListSchemasRequest.builder()- Parameters:
listSchemasRequest- AConsumerthat will call methods onListSchemasRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ListSchemas operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listSchemasPaginator
This is a variant of
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasPublisher publisher = client.listSchemasPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListSchemasPublisher publisher = client.listSchemasPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.- Parameters:
listSchemasRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSchemasPaginator
default ListSchemasPublisher listSchemasPaginator(Consumer<ListSchemasRequest.Builder> listSchemasRequest) This is a variant of
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasPublisher publisher = client.listSchemasPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListSchemasPublisher publisher = client.listSchemasPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.
This is a convenience which creates an instance of the
ListSchemasRequest.Builderavoiding the need to create one manually viaListSchemasRequest.builder()- Parameters:
listSchemasRequest- AConsumerthat will call methods onListSchemasRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listStatements
default CompletableFuture<ListStatementsResponse> listStatements(ListStatementsRequest listStatementsRequest) List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
listStatementsRequest-- Returns:
- A Java Future containing the result of the ListStatements operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listStatements
default CompletableFuture<ListStatementsResponse> listStatements(Consumer<ListStatementsRequest.Builder> listStatementsRequest) List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list.
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
ListStatementsRequest.Builderavoiding the need to create one manually viaListStatementsRequest.builder()- Parameters:
listStatementsRequest- AConsumerthat will call methods onListStatementsRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ListStatements operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listStatementsPaginator
default ListStatementsPublisher listStatementsPaginator(ListStatementsRequest listStatementsRequest) This is a variant of
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsPublisher publisher = client.listStatementsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListStatementsPublisher publisher = client.listStatementsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.- Parameters:
listStatementsRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listStatementsPaginator
default ListStatementsPublisher listStatementsPaginator(Consumer<ListStatementsRequest.Builder> listStatementsRequest) This is a variant of
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsPublisher publisher = client.listStatementsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListStatementsPublisher publisher = client.listStatementsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.
This is a convenience which creates an instance of the
ListStatementsRequest.Builderavoiding the need to create one manually viaListStatementsRequest.builder()- Parameters:
listStatementsRequest- AConsumerthat will call methods onListStatementsRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listTables
List the tables in a database. If neither
SchemaPatternnorTablePatternare specified, then all tables in the database are returned. A token is returned to page through the table list. Depending on the authorization method, use one of the following combinations of request parameters:-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
- Parameters:
listTablesRequest-- Returns:
- A Java Future containing the result of the ListTables operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listTables
default CompletableFuture<ListTablesResponse> listTables(Consumer<ListTablesRequest.Builder> listTablesRequest) List the tables in a database. If neither
SchemaPatternnorTablePatternare specified, then all tables in the database are returned. A token is returned to page through the table list. Depending on the authorization method, use one of the following combinations of request parameters:-
Secrets Manager - when connecting to a cluster, provide the
secret-arnof a secret stored in Secrets Manager which hasusernameandpassword. The specified secret contains credentials to connect to thedatabaseyou specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name. -
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift-serverless:GetCredentialsoperation is required. -
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example,
arn:iam::123456789012:user:foohas the database user nameIAM:foo. Also, permission to call theredshift:GetClusterCredentialsWithIAMoperation is required. -
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the
redshift:GetClusterCredentialsoperation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.
This is a convenience which creates an instance of the
ListTablesRequest.Builderavoiding the need to create one manually viaListTablesRequest.builder()- Parameters:
listTablesRequest- AConsumerthat will call methods onListTablesRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ListTables operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listTablesPaginator
This is a variant of
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesPublisher publisher = client.listTablesPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListTablesPublisher publisher = client.listTablesPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation.- Parameters:
listTablesRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listTablesPaginator
default ListTablesPublisher listTablesPaginator(Consumer<ListTablesRequest.Builder> listTablesRequest) This is a variant of
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesPublisher publisher = client.listTablesPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.redshiftdata.paginators.ListTablesPublisher publisher = client.listTablesPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation.
This is a convenience which creates an instance of the
ListTablesRequest.Builderavoiding the need to create one manually viaListTablesRequest.builder()- Parameters:
listTablesRequest- AConsumerthat will call methods onListTablesRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ValidationException The Amazon Redshift Data API operation failed due to invalid input.
- QueryTimeoutException The Amazon Redshift Data API operation failed due to timeout.
- InternalServerException The Amazon Redshift Data API operation failed due to invalid input.
- DatabaseConnectionException Connection to a database failed.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- RedshiftDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-
create
Create aRedshiftDataAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aRedshiftDataAsyncClient.
-