public abstract class BaseQuery<T> extends Object implements Query<T>
Modifier and Type | Field and Description |
---|---|
static String |
QUERY_ID |
static String |
SQL_QUERY_ID |
static String |
SUB_QUERY_ID |
DATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN
Constructor and Description |
---|
BaseQuery(DataSource dataSource,
QuerySegmentSpec querySegmentSpec,
boolean descending,
Map<String,Object> context) |
BaseQuery(DataSource dataSource,
QuerySegmentSpec querySegmentSpec,
boolean descending,
Map<String,Object> context,
Granularity granularity) |
Modifier and Type | Method and Description |
---|---|
static void |
checkInterrupted() |
static Map<String,Object> |
computeOverriddenContext(Map<String,Object> context,
Map<String,Object> overrides) |
protected Map<String,Object> |
computeOverridenContext(Map<String,Object> overrides)
Deprecated.
use
computeOverriddenContext(getContext(), overrides))
instead. This method may be removed in the next minor or major version of Druid. |
boolean |
equals(Object o) |
Map<String,Object> |
getContext() |
boolean |
getContextBoolean(String key,
boolean defaultValue) |
<ContextType> |
getContextValue(String key) |
<ContextType> |
getContextValue(String key,
ContextType defaultValue) |
DataSource |
getDataSource() |
org.joda.time.Duration |
getDuration() |
Granularity |
getGranularity() |
String |
getId() |
List<org.joda.time.Interval> |
getIntervals() |
QuerySegmentSpec |
getQuerySegmentSpec() |
static QuerySegmentSpec |
getQuerySegmentSpecForLookUp(BaseQuery<?> query) |
com.google.common.collect.Ordering<T> |
getResultOrdering()
Default implementation of
Query.getResultOrdering() that uses Ordering.natural() . |
QueryRunner<T> |
getRunner(QuerySegmentWalker walker) |
String |
getSqlQueryId() |
String |
getSubQueryId()
Returns the subQueryId of this query.
|
org.joda.time.DateTimeZone |
getTimezone() |
int |
hashCode() |
boolean |
isDescending() |
Query<T> |
withId(String id) |
Query<T> |
withSqlQueryId(String sqlQueryId) |
Query<T> |
withSubQueryId(String subQueryId)
Returns a copy of this query with a new subQueryId (see
Query.getSubQueryId() . |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getFilter, getMostSpecificId, getType, getVirtualColumns, hasFilters, optimizeForSegment, withDataSource, withDefaultSubQueryId, withLane, withOverriddenContext, withPriority, withQuerySegmentSpec
public static final String QUERY_ID
public static final String SUB_QUERY_ID
public static final String SQL_QUERY_ID
public BaseQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, boolean descending, Map<String,Object> context)
public BaseQuery(DataSource dataSource, QuerySegmentSpec querySegmentSpec, boolean descending, Map<String,Object> context, Granularity granularity)
public static void checkInterrupted()
public DataSource getDataSource()
getDataSource
in interface Query<T>
public boolean isDescending()
isDescending
in interface Query<T>
public QuerySegmentSpec getQuerySegmentSpec()
public QueryRunner<T> getRunner(QuerySegmentWalker walker)
public static QuerySegmentSpec getQuerySegmentSpecForLookUp(BaseQuery<?> query)
public List<org.joda.time.Interval> getIntervals()
getIntervals
in interface Query<T>
public org.joda.time.Duration getDuration()
getDuration
in interface Query<T>
public Granularity getGranularity()
getGranularity
in interface Query<T>
public org.joda.time.DateTimeZone getTimezone()
getTimezone
in interface Query<T>
public <ContextType> ContextType getContextValue(String key)
getContextValue
in interface Query<T>
public <ContextType> ContextType getContextValue(String key, ContextType defaultValue)
getContextValue
in interface Query<T>
public boolean getContextBoolean(String key, boolean defaultValue)
getContextBoolean
in interface Query<T>
@Deprecated protected Map<String,Object> computeOverridenContext(Map<String,Object> overrides)
computeOverriddenContext(getContext(), overrides))
instead. This method may be removed in the next minor or major version of Druid.public static Map<String,Object> computeOverriddenContext(Map<String,Object> context, Map<String,Object> overrides)
public com.google.common.collect.Ordering<T> getResultOrdering()
Query.getResultOrdering()
that uses Ordering.natural()
.
If your query result type T is not Comparable, you must override this method.getResultOrdering
in interface Query<T>
public Query<T> withSubQueryId(String subQueryId)
Query
Query.getSubQueryId()
.withSubQueryId
in interface Query<T>
@Nullable public String getSubQueryId()
Query
getSubQueryId
in interface Query<T>
@Nullable public String getSqlQueryId()
getSqlQueryId
in interface Query<T>
public Query<T> withSqlQueryId(String sqlQueryId)
withSqlQueryId
in interface Query<T>
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.