public class ScanQuery extends BaseQuery<ScanResultValue>
| Modifier and Type | Class and Description |
|---|---|
static class |
ScanQuery.Order |
static class |
ScanQuery.ResultFormat |
| Modifier and Type | Field and Description |
|---|---|
static String |
CTX_KEY_OUTERMOST
This context flag corresponds to whether the query is running on the "outermost" process (i.e.
|
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_IDDATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN| Constructor and Description |
|---|
ScanQuery(DataSource dataSource,
QuerySegmentSpec querySegmentSpec,
VirtualColumns virtualColumns,
ScanQuery.ResultFormat resultFormat,
int batchSize,
long scanRowsOffset,
long scanRowsLimit,
ScanQuery.Order order,
DimFilter dimFilter,
List<String> columns,
Boolean legacy,
Map<String,Object> context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getBatchSize() |
List<String> |
getColumns() |
DimFilter |
getFilter() |
Integer |
getMaxRowsQueuedForOrdering() |
Integer |
getMaxSegmentPartitionsOrderedInMemory() |
ScanQuery.Order |
getOrder() |
Set<String> |
getRequiredColumns()
Returns the set of columns that this query will need to access out of its datasource.
|
ScanQuery.ResultFormat |
getResultFormat() |
com.google.common.collect.Ordering<ScanResultValue> |
getResultOrdering()
Default implementation of
Query.getResultOrdering() that uses Ordering.natural(). |
long |
getScanRowsLimit()
Limit for this query; behaves like SQL "LIMIT".
|
long |
getScanRowsOffset()
Offset for this query; behaves like SQL "OFFSET".
|
String |
getType() |
VirtualColumns |
getVirtualColumns() |
boolean |
hasFilters() |
int |
hashCode() |
Boolean |
isLegacy()
Compatibility mode with the legacy scan-query extension.
|
boolean |
isLimited()
Returns whether this query is limited or not.
|
String |
toString() |
Query<ScanResultValue> |
withDataSource(DataSource dataSource) |
ScanQuery |
withLimit(long newLimit) |
ScanQuery |
withNonNullLegacy(ScanQueryConfig scanQueryConfig) |
ScanQuery |
withOffset(long newOffset) |
Query<ScanResultValue> |
withOverriddenContext(Map<String,Object> contextOverrides) |
Query<ScanResultValue> |
withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec)
Returns a new query, identical to this one, but with a different associated
QuerySegmentSpec. |
checkInterrupted, computeOverriddenContext, computeOverridenContext, getContext, getContextBoolean, getContextValue, getContextValue, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getQuerySegmentSpecForLookUp, getRunner, getSqlQueryId, getSubQueryId, getTimezone, isDescending, withId, withSqlQueryId, withSubQueryIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMostSpecificId, optimizeForSegment, withDefaultSubQueryId, withLane, withPrioritypublic static final String CTX_KEY_OUTERMOST
public ScanQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, VirtualColumns virtualColumns, ScanQuery.ResultFormat resultFormat, int batchSize, long scanRowsOffset, long scanRowsLimit, ScanQuery.Order order, DimFilter dimFilter, List<String> columns, Boolean legacy, Map<String,Object> context)
public VirtualColumns getVirtualColumns()
public ScanQuery.ResultFormat getResultFormat()
public int getBatchSize()
public long getScanRowsOffset()
public long getScanRowsLimit()
Long.MAX_VALUE is used in
situations where the user wants an effectively unlimited resultset.public boolean isLimited()
Long.MAX_VALUE is used to signify unlimitedness,
this is equivalent to getScanRowsLimit() != Long.Max_VALUE.getScanRowsLimit()public ScanQuery.Order getOrder()
@Nullable public Integer getMaxSegmentPartitionsOrderedInMemory()
public boolean hasFilters()
public DimFilter getFilter()
public String getType()
public Boolean isLegacy()
public com.google.common.collect.Ordering<ScanResultValue> getResultOrdering()
BaseQueryQuery.getResultOrdering() that uses Ordering.natural().
If your query result type T is not Comparable, you must override this method.getResultOrdering in interface Query<ScanResultValue>getResultOrdering in class BaseQuery<ScanResultValue>@Nullable public Set<String> getRequiredColumns()
QueryQueryDataSource, this method will not return the columns used by that subquery. As another example, if a
query is built on a JoinDataSource, this method will not return the columns from the underlying datasources
that are used by the join condition, unless those columns are also used by this query in other ways.
Returns null if the set of required columns cannot be known ahead of time.public ScanQuery withOffset(long newOffset)
public ScanQuery withLimit(long newLimit)
public ScanQuery withNonNullLegacy(ScanQueryConfig scanQueryConfig)
public Query<ScanResultValue> withQuerySegmentSpec(QuerySegmentSpec querySegmentSpec)
QueryQuerySegmentSpec.
This often changes the behavior of Query.getRunner(QuerySegmentWalker), since most queries inherit that method
from BaseQuery, which implements it by calling QuerySegmentSpec.lookup(org.apache.druid.query.Query<T>, org.apache.druid.query.QuerySegmentWalker).public Query<ScanResultValue> withDataSource(DataSource dataSource)
public Query<ScanResultValue> withOverriddenContext(Map<String,Object> contextOverrides)
public boolean equals(Object o)
equals in class BaseQuery<ScanResultValue>public int hashCode()
hashCode in class BaseQuery<ScanResultValue>Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.