Interface RedshiftDataClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder()
method.
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 TypeMethodDescriptiondefault BatchExecuteStatementResponsebatchExecuteStatement(Consumer<BatchExecuteStatementRequest.Builder> batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).default BatchExecuteStatementResponsebatchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest) Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).static RedshiftDataClientBuilderbuilder()Create a builder that can be used to configure and create aRedshiftDataClient.default CancelStatementResponsecancelStatement(Consumer<CancelStatementRequest.Builder> cancelStatementRequest) Cancels a running query.default CancelStatementResponsecancelStatement(CancelStatementRequest cancelStatementRequest) Cancels a running query.static RedshiftDataClientcreate()Create aRedshiftDataClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default DescribeStatementResponsedescribeStatement(Consumer<DescribeStatementRequest.Builder> describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API.default DescribeStatementResponsedescribeStatement(DescribeStatementRequest describeStatementRequest) Describes the details about a specific instance when a query was run by the Amazon Redshift Data API.default DescribeTableResponsedescribeTable(Consumer<DescribeTableRequest.Builder> describeTableRequest) Describes the detailed information about a table from metadata in the cluster.default DescribeTableResponsedescribeTable(DescribeTableRequest describeTableRequest) Describes the detailed information about a table from metadata in the cluster.default DescribeTableIterabledescribeTablePaginator(Consumer<DescribeTableRequest.Builder> describeTableRequest) This is a variant ofdescribeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.default DescribeTableIterabledescribeTablePaginator(DescribeTableRequest describeTableRequest) This is a variant ofdescribeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation.default ExecuteStatementResponseexecuteStatement(Consumer<ExecuteStatementRequest.Builder> executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL).default ExecuteStatementResponseexecuteStatement(ExecuteStatementRequest executeStatementRequest) Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL).default GetStatementResultResponsegetStatementResult(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) Fetches the temporarily cached result of an SQL statement.default GetStatementResultResponsegetStatementResult(GetStatementResultRequest getStatementResultRequest) Fetches the temporarily cached result of an SQL statement.default GetStatementResultIterablegetStatementResultPaginator(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) This is a variant ofgetStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.default GetStatementResultIterablegetStatementResultPaginator(GetStatementResultRequest getStatementResultRequest) This is a variant ofgetStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation.default ListDatabasesResponselistDatabases(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) List the databases in a cluster.default ListDatabasesResponselistDatabases(ListDatabasesRequest listDatabasesRequest) List the databases in a cluster.default ListDatabasesIterablelistDatabasesPaginator(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) This is a variant oflistDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.default ListDatabasesIterablelistDatabasesPaginator(ListDatabasesRequest listDatabasesRequest) This is a variant oflistDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation.default ListSchemasResponselistSchemas(Consumer<ListSchemasRequest.Builder> listSchemasRequest) Lists the schemas in a database.default ListSchemasResponselistSchemas(ListSchemasRequest listSchemasRequest) Lists the schemas in a database.default ListSchemasIterablelistSchemasPaginator(Consumer<ListSchemasRequest.Builder> listSchemasRequest) This is a variant oflistSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.default ListSchemasIterablelistSchemasPaginator(ListSchemasRequest listSchemasRequest) This is a variant oflistSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation.default ListStatementsResponselistStatements(Consumer<ListStatementsRequest.Builder> listStatementsRequest) List of SQL statements.default ListStatementsResponselistStatements(ListStatementsRequest listStatementsRequest) List of SQL statements.default ListStatementsIterablelistStatementsPaginator(Consumer<ListStatementsRequest.Builder> listStatementsRequest) This is a variant oflistStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.default ListStatementsIterablelistStatementsPaginator(ListStatementsRequest listStatementsRequest) This is a variant oflistStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation.default ListTablesResponselistTables(Consumer<ListTablesRequest.Builder> listTablesRequest) List the tables in a database.default ListTablesResponselistTables(ListTablesRequest listTablesRequest) List the tables in a database.default ListTablesIterablelistTablesPaginator(Consumer<ListTablesRequest.Builder> listTablesRequest) This is a variant oflistTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation.default ListTablesIterablelistTablesPaginator(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., ClientOverrideConfigurationstatic ServiceMetadataMethods 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 BatchExecuteStatementResponse batchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest) throws ValidationException, ActiveSessionsExceededException, ActiveStatementsExceededException, BatchExecuteStatementException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the BatchExecuteStatement operation returned by the service.
- See Also:
-
-
batchExecuteStatement
default BatchExecuteStatementResponse batchExecuteStatement(Consumer<BatchExecuteStatementRequest.Builder> batchExecuteStatementRequest) throws ValidationException, ActiveSessionsExceededException, ActiveStatementsExceededException, BatchExecuteStatementException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the BatchExecuteStatement operation returned by the service.
- See Also:
-
-
cancelStatement
default CancelStatementResponse cancelStatement(CancelStatementRequest cancelStatementRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the CancelStatement operation returned by the service.
- See Also:
-
cancelStatement
default CancelStatementResponse cancelStatement(Consumer<CancelStatementRequest.Builder> cancelStatementRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the CancelStatement operation returned by the service.
- See Also:
-
describeStatement
default DescribeStatementResponse describeStatement(DescribeStatementRequest describeStatementRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the DescribeStatement operation returned by the service.
- See Also:
-
describeStatement
default DescribeStatementResponse describeStatement(Consumer<DescribeStatementRequest.Builder> describeStatementRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the DescribeStatement operation returned by the service.
- See Also:
-
describeTable
default DescribeTableResponse describeTable(DescribeTableRequest describeTableRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the DescribeTable operation returned by the service.
- See Also:
-
-
describeTable
default DescribeTableResponse describeTable(Consumer<DescribeTableRequest.Builder> describeTableRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the DescribeTable operation returned by the service.
- See Also:
-
-
describeTablePaginator
default DescribeTableIterable describeTablePaginator(DescribeTableRequest describeTableRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client.describeTablePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client .describeTablePaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client.describeTablePaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
describeTablePaginator
default DescribeTableIterable describeTablePaginator(Consumer<DescribeTableRequest.Builder> describeTableRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
describeTable(software.amazon.awssdk.services.redshiftdata.model.DescribeTableRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client.describeTablePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client .describeTablePaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.DescribeTableResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.DescribeTableIterable responses = client.describeTablePaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
executeStatement
default ExecuteStatementResponse executeStatement(ExecuteStatementRequest executeStatementRequest) throws ValidationException, ActiveSessionsExceededException, ExecuteStatementException, ActiveStatementsExceededException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ExecuteStatement operation returned by the service.
- See Also:
-
-
executeStatement
default ExecuteStatementResponse executeStatement(Consumer<ExecuteStatementRequest.Builder> executeStatementRequest) throws ValidationException, ActiveSessionsExceededException, ExecuteStatementException, ActiveStatementsExceededException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ExecuteStatement operation returned by the service.
- See Also:
-
-
getStatementResult
default GetStatementResultResponse getStatementResult(GetStatementResultRequest getStatementResultRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the GetStatementResult operation returned by the service.
- See Also:
-
getStatementResult
default GetStatementResultResponse getStatementResult(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the GetStatementResult operation returned by the service.
- See Also:
-
getStatementResultPaginator
default GetStatementResultIterable getStatementResultPaginator(GetStatementResultRequest getStatementResultRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client.getStatementResultPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client .getStatementResultPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client.getStatementResultPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
getStatementResultPaginator
default GetStatementResultIterable getStatementResultPaginator(Consumer<GetStatementResultRequest.Builder> getStatementResultRequest) throws ValidationException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
getStatementResult(software.amazon.awssdk.services.redshiftdata.model.GetStatementResultRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client.getStatementResultPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client .getStatementResultPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.GetStatementResultResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.GetStatementResultIterable responses = client.getStatementResultPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listDatabases
default ListDatabasesResponse listDatabases(ListDatabasesRequest listDatabasesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListDatabases operation returned by the service.
- See Also:
-
-
listDatabases
default ListDatabasesResponse listDatabases(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListDatabases operation returned by the service.
- See Also:
-
-
listDatabasesPaginator
default ListDatabasesIterable listDatabasesPaginator(ListDatabasesRequest listDatabasesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client.listDatabasesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client .listDatabasesPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client.listDatabasesPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listDatabasesPaginator
default ListDatabasesIterable listDatabasesPaginator(Consumer<ListDatabasesRequest.Builder> listDatabasesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listDatabases(software.amazon.awssdk.services.redshiftdata.model.ListDatabasesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client.listDatabasesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client .listDatabasesPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListDatabasesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListDatabasesIterable responses = client.listDatabasesPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listSchemas
default ListSchemasResponse listSchemas(ListSchemasRequest listSchemasRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListSchemas operation returned by the service.
- See Also:
-
-
listSchemas
default ListSchemasResponse listSchemas(Consumer<ListSchemasRequest.Builder> listSchemasRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListSchemas operation returned by the service.
- See Also:
-
-
listSchemasPaginator
default ListSchemasIterable listSchemasPaginator(ListSchemasRequest listSchemasRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listSchemasPaginator
default ListSchemasIterable listSchemasPaginator(Consumer<ListSchemasRequest.Builder> listSchemasRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listSchemas(software.amazon.awssdk.services.redshiftdata.model.ListSchemasRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListSchemasResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListSchemasIterable responses = client.listSchemasPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listStatements
default ListStatementsResponse listStatements(ListStatementsRequest listStatementsRequest) throws ValidationException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListStatements operation returned by the service.
- See Also:
-
listStatements
default ListStatementsResponse listStatements(Consumer<ListStatementsRequest.Builder> listStatementsRequest) throws ValidationException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListStatements operation returned by the service.
- See Also:
-
listStatementsPaginator
default ListStatementsIterable listStatementsPaginator(ListStatementsRequest listStatementsRequest) throws ValidationException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client.listStatementsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client .listStatementsPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client.listStatementsPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listStatementsPaginator
default ListStatementsIterable listStatementsPaginator(Consumer<ListStatementsRequest.Builder> listStatementsRequest) throws ValidationException, InternalServerException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listStatements(software.amazon.awssdk.services.redshiftdata.model.ListStatementsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client.listStatementsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client .listStatementsPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListStatementsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListStatementsIterable responses = client.listStatementsPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listTables
default ListTablesResponse listTables(ListTablesRequest listTablesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListTables operation returned by the service.
- See Also:
-
-
listTables
default ListTablesResponse listTables(Consumer<ListTablesRequest.Builder> listTablesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException 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:
- Result of the ListTables operation returned by the service.
- See Also:
-
-
listTablesPaginator
default ListTablesIterable listTablesPaginator(ListTablesRequest listTablesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listTablesPaginator
default ListTablesIterable listTablesPaginator(Consumer<ListTablesRequest.Builder> listTablesRequest) throws ValidationException, QueryTimeoutException, InternalServerException, DatabaseConnectionException, AwsServiceException, SdkClientException, RedshiftDataException This is a variant of
listTables(software.amazon.awssdk.services.redshiftdata.model.ListTablesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); for (software.amazon.awssdk.services.redshiftdata.model.ListTablesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.redshiftdata.paginators.ListTablesIterable responses = client.listTablesPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aRedshiftDataClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aRedshiftDataClient. -
serviceMetadata
-
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
-