Package org.apache.druid.query.operator
Class WindowOperatorQuery
- java.lang.Object
-
- org.apache.druid.query.BaseQuery<RowsAndColumns>
-
- org.apache.druid.query.operator.WindowOperatorQuery
-
- All Implemented Interfaces:
Query<RowsAndColumns>
public class WindowOperatorQuery extends BaseQuery<RowsAndColumns>
A query that can compute window functions on top of a completely in-memory inline datasource or query results.It relies on a set of Operators to work on the data that it is given. As such, it doesn't actually encapsulate any window-specific logic in-and-of-itself, but rather delegates everything to the operators. This is because this is also intended as the initial addition of more explicit Operators to the Druid code base.
The assumptions on the incoming data are defined by the operators. At initial time of writing, there is a baked in assumption that data has been sorted "correctly" before this runs.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.query.BaseQuery
QUERY_ID, SQL_QUERY_ID, SUB_QUERY_ID
-
Fields inherited from interface org.apache.druid.query.Query
DATASOURCE_METADATA, GROUP_BY, SCAN, SEARCH, SEGMENT_METADATA, SELECT, TIME_BOUNDARY, TIMESERIES, TOPN, WINDOW_OPERATOR
-
-
Constructor Summary
Constructors Constructor Description WindowOperatorQuery(DataSource dataSource, QuerySegmentSpec intervals, Map<String,Object> context, RowSignature rowSignature, List<OperatorFactory> operators, List<OperatorFactory> leafOperators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
DimFilter
getFilter()
List<OperatorFactory>
getLeafOperators()
List<OperatorFactory>
getOperators()
RowSignature
getRowSignature()
String
getType()
boolean
hasFilters()
int
hashCode()
String
toString()
Query<RowsAndColumns>
withDataSource(DataSource dataSource)
Query<RowsAndColumns>
withOperators(List<OperatorFactory> operators)
Query<RowsAndColumns>
withOverriddenContext(Map<String,Object> contextOverride)
Query<RowsAndColumns>
withQuerySegmentSpec(QuerySegmentSpec spec)
Returns a new query, identical to this one, but with a different associatedQuerySegmentSpec
.-
Methods inherited from class org.apache.druid.query.BaseQuery
checkInterrupted, computeOverriddenContext, computeOverridenContext, context, getContext, getDataSource, getDuration, getGranularity, getId, getIntervals, getQuerySegmentSpec, getQuerySegmentSpecForLookUp, getResultOrdering, getRunner, getSubQueryId, getTimezone, isDescending, withId, withSqlQueryId, withSubQueryId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.Query
getContextBoolean, getContextHumanReadableBytes, getContextValue, getMostSpecificId, getRequiredColumns, getSqlQueryId, getVirtualColumns, optimizeForSegment, withDefaultSubQueryId, withLane, withPriority
-
-
-
-
Constructor Detail
-
WindowOperatorQuery
public WindowOperatorQuery(DataSource dataSource, QuerySegmentSpec intervals, Map<String,Object> context, RowSignature rowSignature, List<OperatorFactory> operators, List<OperatorFactory> leafOperators)
-
-
Method Detail
-
getOperators
public List<OperatorFactory> getOperators()
-
getLeafOperators
public List<OperatorFactory> getLeafOperators()
-
getRowSignature
public RowSignature getRowSignature()
-
hasFilters
public boolean hasFilters()
-
getType
public String getType()
-
withOverriddenContext
public Query<RowsAndColumns> withOverriddenContext(Map<String,Object> contextOverride)
-
withQuerySegmentSpec
public Query<RowsAndColumns> withQuerySegmentSpec(QuerySegmentSpec spec)
Description copied from interface:Query
Returns a new query, identical to this one, but with a different associatedQuerySegmentSpec
. This often changes the behavior ofQuery.getRunner(QuerySegmentWalker)
, since most queries inherit that method fromBaseQuery
, which implements it by callingQuerySegmentSpec.lookup(org.apache.druid.query.Query<T>, org.apache.druid.query.QuerySegmentWalker)
.
-
withDataSource
public Query<RowsAndColumns> withDataSource(DataSource dataSource)
-
withOperators
public Query<RowsAndColumns> withOperators(List<OperatorFactory> operators)
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classBaseQuery<RowsAndColumns>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseQuery<RowsAndColumns>
-
-