Query options
- Global
- This type is global
- Properties:
Name Type Description autoPage BooleanDetermines if the driver must retrieve the following result pages automatically.
captureStackTrace BooleanDetermines if the stack trace before the query execution should be maintained.
Useful for debugging purposes, it should be set to
Default: false.falseunder production environment as it adds an unnecessary overhead to each execution.consistency NumberConsistency level. Default: localOne.customPayload ObjectKey-value payload to be passed to the server. On the Cassandra side, implementations of QueryHandler can use this data.
fetchSize NumberAmount of rows to retrieve per page.
hints ArrayorArray<Array>Type hints for parameters given in the query, ordered as for the parameters.
For batch queries, an array of such arrays, ordered as with the queries in the batch.
logged BooleanDetermines if the batch should be written to the batchlog. Only valid for
Client#batch(), it will be ignored by other methods. Default: true.pageState BufferorStringBuffer or string token representing the paging state.
Useful for manual paging, if provided, the query will be executed starting from a given paging state.
prepare BooleanDetermines if the query must be executed as a prepared statement.
readTimeout NumberWhen defined, it overrides the default read timeout (
socketOptions.readTimeout) in milliseconds for this execution per coordinator.Suitable for statements for which the coordinator may allow a longer server-side timeout, for example aggregation queries.
A value of
0disables client side read timeout for the execution. Default:undefined.retry RetryPolicyRetry policy for the query.
This property can be used to specify a different
retry policyto the one specified in theClientOptions.policies.retryOnTimeout BooleanDetermines if the client should retry when it didn’t hear back from a host within
socketOptions.readTimeout. Default: true.routingIndexes ArrayIndex of the parameters that are part of the partition key to determine the routing.
routingKey BufferorArrayPartition key(s) to determine which coordinator should be used for the query.
routingNames ArrayArray of the parameters names that are part of the partition key to determine the routing.
serialConsistency NumberSerial consistency is the consistency level for the serial phase of conditional updates. This option will be ignored for anything else that a conditional update/insert.
timestamp NumberorLongThe default timestamp for the query in microseconds from the unix epoch (00:00:00, January 1st, 1970).
If provided, this will replace the server side assigned timestamp as default timestamp.
Use
generateTimestamp()utility method to generate a valid timestamp based on a Date and microseconds parts.traceQuery BooleanEnable query tracing for the execution. Use query tracing to diagnose performance problems related to query executions. Default: false.
To retrieve trace, you can call
Metadata.getTrace()method.