Interface QueryRequest.Builder
-
- All Superinterfaces:
AwsRequest.Builder,Buildable,CopyableBuilder<QueryRequest.Builder,QueryRequest>,SdkBuilder<QueryRequest.Builder,QueryRequest>,SdkPojo,SdkRequest.Builder,TimestreamQueryRequest.Builder
- Enclosing class:
- QueryRequest
public static interface QueryRequest.Builder extends TimestreamQueryRequest.Builder, SdkPojo, CopyableBuilder<QueryRequest.Builder,QueryRequest>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QueryRequest.BuilderclientToken(String clientToken)Unique, case-sensitive string of up to 64 ASCII characters specified when aQueryrequest is made.QueryRequest.BuildermaxRows(Integer maxRows)The total number of rows to be returned in theQueryoutput.QueryRequest.BuildernextToken(String nextToken)A pagination token used to return a set of results.QueryRequest.BuilderoverrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)QueryRequest.BuilderoverrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)QueryRequest.BuilderqueryString(String queryString)The query to be run by Timestream.-
Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfiguration
-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
Methods inherited from interface software.amazon.awssdk.services.timestreamquery.model.TimestreamQueryRequest.Builder
build
-
-
-
-
Method Detail
-
queryString
QueryRequest.Builder queryString(String 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
QueryRequest.Builder clientToken(String 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
QueryRequest.Builder nextToken(String 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
QueryRequest.Builder maxRows(Integer 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
QueryRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder
-
overrideConfiguration
QueryRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
- Specified by:
overrideConfigurationin interfaceAwsRequest.Builder
-
-