Interface QueryRequest.Builder
- All Superinterfaces:
AwsRequest.Builder,Buildable,CopyableBuilder<QueryRequest.Builder,,QueryRequest> SdkBuilder<QueryRequest.Builder,,QueryRequest> SdkPojo,SdkRequest.Builder,TimestreamQueryRequest.Builder
- Enclosing class:
QueryRequest
-
Method Summary
Modifier and TypeMethodDescriptionclientToken(String clientToken) Unique, case-sensitive string of up to 64 ASCII characters specified when aQueryrequest is made.The total number of rows to be returned in theQueryoutput.A pagination token used to return a set of results.overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Add an optional request override configuration.overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Add an optional request override configuration.queryString(String queryString) The query to be run by Timestream.Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copyMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldsMethods inherited from interface software.amazon.awssdk.services.timestreamquery.model.TimestreamQueryRequest.Builder
build
-
Method Details
-
queryString
The query to be run by Timestream.
- Parameters:
queryString- The query to be run by Timestream.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
clientToken
Unique, case-sensitive string of up to 64 ASCII characters specified when a
Queryrequest is made. Providing aClientTokenmakes the call toQueryidempotent. This means that running the same query repeatedly will produce the same result. In other words, making multiple identicalQueryrequests has the same effect as making a single request. When usingClientTokenin a query, note the following:-
If the Query API is instantiated without a
ClientToken, the Query SDK generates aClientTokenon your behalf. -
If the
Queryinvocation only contains theClientTokenbut does not include aNextToken, that invocation ofQueryis assumed to be a new query run. -
If the invocation contains
NextToken, that particular invocation is assumed to be a subsequent invocation of a prior call to the Query API, and a result set is returned. -
After 4 hours, any request with the same
ClientTokenis treated as a new request.
- Parameters:
clientToken- Unique, case-sensitive string of up to 64 ASCII characters specified when aQueryrequest is made. Providing aClientTokenmakes the call toQueryidempotent. This means that running the same query repeatedly will produce the same result. In other words, making multiple identicalQueryrequests has the same effect as making a single request. When usingClientTokenin a query, note the following:-
If the Query API is instantiated without a
ClientToken, the Query SDK generates aClientTokenon your behalf. -
If the
Queryinvocation only contains theClientTokenbut does not include aNextToken, that invocation ofQueryis assumed to be a new query run. -
If the invocation contains
NextToken, that particular invocation is assumed to be a subsequent invocation of a prior call to the Query API, and a result set is returned. -
After 4 hours, any request with the same
ClientTokenis treated as a new request.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
nextToken
A pagination token used to return a set of results. When the
QueryAPI is invoked usingNextToken, that particular invocation is assumed to be a subsequent invocation of a prior call toQuery, and a result set is returned. However, if theQueryinvocation only contains theClientToken, that invocation ofQueryis assumed to be a new query run.Note the following when using NextToken in a query:
-
A pagination token can be used for up to five
Queryinvocations, OR for a duration of up to 1 hour – whichever comes first. -
Using the same
NextTokenwill return the same set of records. To keep paginating through the result set, you must to use the most recentnextToken. -
Suppose a
Queryinvocation returns twoNextTokenvalues,TokenAandTokenB. IfTokenBis used in a subsequentQueryinvocation, thenTokenAis invalidated and cannot be reused. -
To request a previous result set from a query after pagination has begun, you must re-invoke the Query API.
-
The latest
NextTokenshould be used to paginate untilnullis returned, at which point a newNextTokenshould be used. -
If the IAM principal of the query initiator and the result reader are not the same and/or the query initiator and the result reader do not have the same query string in the query requests, the query will fail with an
Invalid pagination tokenerror.
- Parameters:
nextToken- A pagination token used to return a set of results. When theQueryAPI is invoked usingNextToken, that particular invocation is assumed to be a subsequent invocation of a prior call toQuery, and a result set is returned. However, if theQueryinvocation only contains theClientToken, that invocation ofQueryis assumed to be a new query run.Note the following when using NextToken in a query:
-
A pagination token can be used for up to five
Queryinvocations, OR for a duration of up to 1 hour – whichever comes first. -
Using the same
NextTokenwill return the same set of records. To keep paginating through the result set, you must to use the most recentnextToken. -
Suppose a
Queryinvocation returns twoNextTokenvalues,TokenAandTokenB. IfTokenBis used in a subsequentQueryinvocation, thenTokenAis invalidated and cannot be reused. -
To request a previous result set from a query after pagination has begun, you must re-invoke the Query API.
-
The latest
NextTokenshould be used to paginate untilnullis returned, at which point a newNextTokenshould be used. -
If the IAM principal of the query initiator and the result reader are not the same and/or the query initiator and the result reader do not have the same query string in the query requests, the query will fail with an
Invalid pagination tokenerror.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
maxRows
The total number of rows to be returned in the
Queryoutput. The initial run ofQuerywith aMaxRowsvalue specified will return the result set of the query in two cases:-
The size of the result is less than
1MB. -
The number of rows in the result set is less than the value of
maxRows.
Otherwise, the initial invocation of
Queryonly returns aNextToken, which can then be used in subsequent calls to fetch the result set. To resume pagination, provide theNextTokenvalue in the subsequent command.If the row size is large (e.g. a row has many columns), Timestream may return fewer rows to keep the response size from exceeding the 1 MB limit. If
MaxRowsis not provided, Timestream will send the necessary number of rows to meet the 1 MB limit.- Parameters:
maxRows- The total number of rows to be returned in theQueryoutput. The initial run ofQuerywith aMaxRowsvalue specified will return the result set of the query in two cases:-
The size of the result is less than
1MB. -
The number of rows in the result set is less than the value of
maxRows.
Otherwise, the initial invocation of
Queryonly returns aNextToken, which can then be used in subsequent calls to fetch the result set. To resume pagination, provide theNextTokenvalue in the subsequent command.If the row size is large (e.g. a row has many columns), Timestream may return fewer rows to keep the response size from exceeding the 1 MB limit. If
MaxRowsis not provided, Timestream will send the necessary number of rows to meet the 1 MB limit.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
overrideConfiguration
Description copied from interface:AwsRequest.BuilderAdd an optional request override configuration.- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder- Parameters:
overrideConfiguration- The override configuration.- Returns:
- This object for method chaining.
-
overrideConfiguration
QueryRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Description copied from interface:AwsRequest.BuilderAdd an optional request override configuration.- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder- Parameters:
builderConsumer- AConsumerto which an emptyAwsRequestOverrideConfiguration.Builderwill be given.- Returns:
- This object for method chaining.
-