public class SelectStatement extends java.lang.Object implements CQLStatement.SingleKeyspaceCqlStatement
| Modifier and Type | Class and Description |
|---|---|
static class |
SelectStatement.Parameters |
static class |
SelectStatement.RawStatement |
CQLStatement.Raw, CQLStatement.SingleKeyspaceCqlStatement| Modifier and Type | Field and Description |
|---|---|
VariableSpecifications |
bindVariables |
static int |
DEFAULT_PAGE_SIZE |
SelectStatement.Parameters |
parameters |
TableMetadata |
table |
| Constructor and Description |
|---|
SelectStatement(TableMetadata table,
VariableSpecifications bindVariables,
SelectStatement.Parameters parameters,
Selection selection,
StatementRestrictions restrictions,
boolean isReversed,
AggregationSpecification aggregationSpec,
java.util.Comparator<java.util.List<java.nio.ByteBuffer>> orderingComparator,
Term limit,
Term perPartitionLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
authorize(ClientState state)
Perform any access verification necessary for the statement.
|
Slices |
clusteringIndexFilterAsSlices()
Returns the slices fetched by this SELECT, assuming an internal call (no bound values in particular).
|
java.lang.String |
columnFamily() |
ResultMessage.Rows |
execute(QueryState state,
QueryOptions options,
long queryStartNanoTime)
Execute the statement and return the resulting result or null if there is no result.
|
ResultMessage.Rows |
executeInternal(QueryState state,
QueryOptions options,
int nowInSec,
long queryStartNanoTime) |
ResultMessage.Rows |
executeLocally(QueryState state,
QueryOptions options)
Variant of execute used for internal query against the system tables, and thus only query the local node.
|
AuditLogContext |
getAuditLogContext()
Provides the context needed for audit logging statements.
|
java.util.List<ColumnSpecification> |
getBindVariables()
Returns all bind variables for the statement
|
static java.nio.ByteBuffer[] |
getComponents(TableMetadata metadata,
DecoratedKey dk) |
java.lang.Iterable<Function> |
getFunctions()
Return an Iterable over all of the functions (both native and user-defined) used by any component of the statement
|
int |
getLimit(QueryOptions options)
Returns the limit specified by the user.
|
short[] |
getPartitionKeyBindVariableIndexes()
Returns an array with the same length as the number of partition key columns for the table corresponding
to table.
|
int |
getPerPartitionLimit(QueryOptions options)
Returns the per partition limit specified by the user.
|
ReadQuery |
getQuery(QueryOptions options,
ColumnFilter columnFilter,
int nowInSec,
int userLimit,
int perPartitionLimit,
int pageSize) |
ReadQuery |
getQuery(QueryOptions options,
int nowInSec) |
StatementRestrictions |
getRestrictions()
May be used by custom QueryHandler implementations
|
ResultSet.ResultMetadata |
getResultMetadata() |
RowFilter |
getRowFilter(QueryOptions options)
May be used by custom QueryHandler implementations
|
Selection |
getSelection()
May be used by custom QueryHandler implementations
|
SinglePartitionReadCommand |
internalReadForView(DecoratedKey key,
int nowInSec)
Returns a read command that can be used internally to query all the rows queried by this SELECT for a
give key (used for materialized views).
|
java.lang.String |
keyspace() |
Slices |
makeSlices(QueryOptions options) |
ResultSet |
process(PartitionIterator partitions,
int nowInSec) |
ColumnFilter |
queriedColumns()
The columns to fetch internally for this SELECT statement (which can be more than the one selected by the
user as it also include any restricted column in particular).
|
RowFilter |
rowFilterForInternalCalls()
The
RowFilter for this SELECT, assuming an internal call (no bound values in particular). |
java.lang.String |
toString() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasConditionspublic static final int DEFAULT_PAGE_SIZE
public final VariableSpecifications bindVariables
public final TableMetadata table
public final SelectStatement.Parameters parameters
public SelectStatement(TableMetadata table, VariableSpecifications bindVariables, SelectStatement.Parameters parameters, Selection selection, StatementRestrictions restrictions, boolean isReversed, AggregationSpecification aggregationSpec, java.util.Comparator<java.util.List<java.nio.ByteBuffer>> orderingComparator, Term limit, Term perPartitionLimit)
public java.util.List<ColumnSpecification> getBindVariables()
CQLStatementgetBindVariables in interface CQLStatementpublic short[] getPartitionKeyBindVariableIndexes()
CQLStatementgetPartitionKeyBindVariableIndexes in interface CQLStatementpublic java.lang.Iterable<Function> getFunctions()
CQLStatementgetFunctions in interface CQLStatementpublic ColumnFilter queriedColumns()
public ResultSet.ResultMetadata getResultMetadata()
public void authorize(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatementauthorize in interface CQLStatementstate - the current client stateInvalidRequestExceptionUnauthorizedExceptionpublic void validate(ClientState state) throws InvalidRequestException
CQLStatementvalidate in interface CQLStatementstate - the current client stateInvalidRequestExceptionpublic ResultMessage.Rows execute(QueryState state, QueryOptions options, long queryStartNanoTime)
CQLStatementexecute in interface CQLStatementstate - the current query stateoptions - options for this query (consistency, variables, pageSize, ...)queryStartNanoTime - the timestamp returned by System.nanoTime() when this statement was receivedpublic ReadQuery getQuery(QueryOptions options, int nowInSec) throws RequestValidationException
RequestValidationExceptionpublic ReadQuery getQuery(QueryOptions options, ColumnFilter columnFilter, int nowInSec, int userLimit, int perPartitionLimit, int pageSize)
public AuditLogContext getAuditLogContext()
CQLStatementgetAuditLogContext in interface CQLStatementpublic ResultMessage.Rows executeLocally(QueryState state, QueryOptions options) throws RequestExecutionException, RequestValidationException
CQLStatementexecuteLocally in interface CQLStatementstate - the current query stateRequestExecutionExceptionRequestValidationExceptionpublic ResultMessage.Rows executeInternal(QueryState state, QueryOptions options, int nowInSec, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
public ResultSet process(PartitionIterator partitions, int nowInSec) throws InvalidRequestException
InvalidRequestExceptionpublic java.lang.String keyspace()
keyspace in interface CQLStatement.SingleKeyspaceCqlStatementpublic java.lang.String columnFamily()
public Selection getSelection()
public StatementRestrictions getRestrictions()
public Slices clusteringIndexFilterAsSlices()
Note that if the SELECT intrinsically selects rows by names, we convert them into equivalent slices for the purpose of this method. This is used for MVs to restrict what needs to be read when we want to read everything that could be affected by a given view (and so, if the view SELECT statement has restrictions on the clustering columns, we can restrict what we read).
public SinglePartitionReadCommand internalReadForView(DecoratedKey key, int nowInSec)
public RowFilter rowFilterForInternalCalls()
RowFilter for this SELECT, assuming an internal call (no bound values in particular).public Slices makeSlices(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic int getLimit(QueryOptions options)
DataLimits.NO_LIMIT if no value
as been specified.public int getPerPartitionLimit(QueryOptions options)
DataLimits.NO_LIMIT if no value
as been specified.public RowFilter getRowFilter(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic static java.nio.ByteBuffer[] getComponents(TableMetadata metadata, DecoratedKey dk)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009-2022 The Apache Software Foundation