Class ElasticsearchAggregate
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.SingleRel
-
- org.apache.calcite.rel.core.Aggregate
-
- org.apache.calcite.adapter.elasticsearch.ElasticsearchAggregate
-
- All Implemented Interfaces:
java.lang.Cloneable
,ElasticsearchRel
,RelOptNode
,RelNode
public class ElasticsearchAggregate extends Aggregate implements ElasticsearchRel
Implementation ofAggregate
relational expression for ElasticSearch.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.rel.core.Aggregate
Aggregate.AggCallBinding, Aggregate.Group
-
Nested classes/interfaces inherited from interface org.apache.calcite.adapter.elasticsearch.ElasticsearchRel
ElasticsearchRel.Implementor
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Set<SqlKind>
SUPPORTED_AGGREGATIONS
-
Fields inherited from class org.apache.calcite.rel.core.Aggregate
aggCalls, groupSet, groupSets, indicator, IS_NOT_GRAND_TOTAL, IS_SIMPLE, NO_INDICATOR
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Fields inherited from interface org.apache.calcite.adapter.elasticsearch.ElasticsearchRel
CONVENTION
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
Creates a ElasticsearchAggregate
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelOptCost
computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Returns the cost of this plan (not including children).Aggregate
copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
Creates a copy of this aggregate.private java.util.List<java.lang.String>
fieldNames(RelDataType relDataType)
void
implement(ElasticsearchRel.Implementor implementor)
private java.lang.String
toElasticAggregate(AggregateCall call)
Most of the aggregations can be retrieved with single stats function.-
Methods inherited from class org.apache.calcite.rel.core.Aggregate
containsDistinctCall, copy, deriveRowType, deriveRowType, estimateRowCount, explainTerms, getAggCallList, getGroupCount, getGroupSet, getGroupSets, getGroupType, getIndicatorCount, getNamedAggCalls, isNotGrandTotal, isSimple, isValid, noIndicator
-
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, getInput, getInputs, replaceInput
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.rel.RelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
-
Methods inherited from interface org.apache.calcite.plan.RelOptNode
getCluster, getDescription, getDigest, getId, getTraitSet
-
-
-
-
Field Detail
-
SUPPORTED_AGGREGATIONS
private static final java.util.Set<SqlKind> SUPPORTED_AGGREGATIONS
-
-
Constructor Detail
-
ElasticsearchAggregate
ElasticsearchAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls) throws InvalidRelException
Creates a ElasticsearchAggregate- Throws:
InvalidRelException
-
-
Method Detail
-
copy
public Aggregate copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
Description copied from class:Aggregate
Creates a copy of this aggregate.- Specified by:
copy
in classAggregate
- Parameters:
traitSet
- Traitsinput
- Inputindicator
- Whether row type should include indicator fields to indicate which grouping set is active; must be true if aggregate is not simplegroupSet
- Bit set of grouping fieldsgroupSets
- List of all grouping sets; null for justgroupSet
aggCalls
- Collection of calls to aggregate functions- Returns:
- New
Aggregate
if any parameter differs from the value of thisAggregate
, or justthis
if all the parameters are the same - See Also:
Aggregate.copy(org.apache.calcite.plan.RelTraitSet, java.util.List)
-
computeSelfCost
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Description copied from interface:RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about cost.- Specified by:
computeSelfCost
in interfaceRelNode
- Overrides:
computeSelfCost
in classAggregate
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
implement
public void implement(ElasticsearchRel.Implementor implementor)
- Specified by:
implement
in interfaceElasticsearchRel
-
toElasticAggregate
private java.lang.String toElasticAggregate(AggregateCall call)
Most of the aggregations can be retrieved with single stats function. But currently only one-to-one mapping is supported between sql agg and elastic aggregation.
-
fieldNames
private java.util.List<java.lang.String> fieldNames(RelDataType relDataType)
-
-