public abstract class Match extends SingleRel
Each output row has the columns defined in the measure statements.
Modifier and Type | Class and Description |
---|---|
private static class |
Match.AggregateFinder
Find aggregate functions in operands.
|
private static class |
Match.PatternVarFinder
Visits the operands of an aggregate call to retrieve relevant pattern
variables.
|
static class |
Match.RexMRAggCall
Aggregate calls in match recognize.
|
RelNode.Context
Modifier and Type | Field and Description |
---|---|
protected RexNode |
after |
protected java.util.Set<Match.RexMRAggCall> |
aggregateCalls |
protected java.util.Map<java.lang.String,java.util.SortedSet<Match.RexMRAggCall>> |
aggregateCallsPreVar |
protected boolean |
allRows |
protected RexNode |
interval |
protected com.google.common.collect.ImmutableMap<java.lang.String,RexNode> |
measures |
protected RelCollation |
orderKeys |
protected java.util.List<RexNode> |
partitionKeys |
protected RexNode |
pattern |
protected com.google.common.collect.ImmutableMap<java.lang.String,RexNode> |
patternDefinitions |
private static java.lang.String |
STAR |
protected boolean |
strictEnd |
protected boolean |
strictStart |
protected com.google.common.collect.ImmutableMap<java.lang.String,java.util.SortedSet<java.lang.String>> |
subsets |
digest, id, rowType, traitSet
Modifier | Constructor and Description |
---|---|
protected |
Match(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RelDataType rowType,
RexNode pattern,
boolean strictStart,
boolean strictEnd,
java.util.Map<java.lang.String,RexNode> patternDefinitions,
java.util.Map<java.lang.String,RexNode> measures,
RexNode after,
java.util.Map<java.lang.String,? extends java.util.SortedSet<java.lang.String>> subsets,
boolean allRows,
java.util.List<RexNode> partitionKeys,
RelCollation orderKeys,
RexNode interval)
Creates a Match.
|
Modifier and Type | Method and Description |
---|---|
abstract Match |
copy(RelNode input,
RelDataType rowType,
RexNode pattern,
boolean strictStart,
boolean strictEnd,
java.util.Map<java.lang.String,RexNode> patternDefinitions,
java.util.Map<java.lang.String,RexNode> measures,
RexNode after,
java.util.Map<java.lang.String,? extends java.util.SortedSet<java.lang.String>> subsets,
boolean allRows,
java.util.List<RexNode> partitionKeys,
RelCollation orderKeys,
RexNode interval) |
RelNode |
copy(RelTraitSet traitSet,
java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and
inputs.
|
private static <K extends java.lang.Comparable<K>,V> |
copyMap(java.util.Map<K,? extends java.util.SortedSet<V>> map)
Creates an immutable map of a map of sorted sets.
|
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
RexNode |
getAfter() |
RexNode |
getInterval() |
com.google.common.collect.ImmutableMap<java.lang.String,RexNode> |
getMeasures() |
RelCollation |
getOrderKeys() |
java.util.List<RexNode> |
getPartitionKeys() |
RexNode |
getPattern() |
com.google.common.collect.ImmutableMap<java.lang.String,RexNode> |
getPatternDefinitions() |
com.google.common.collect.ImmutableMap<java.lang.String,java.util.SortedSet<java.lang.String>> |
getSubsets() |
boolean |
isAllRows() |
boolean |
isStrictEnd() |
boolean |
isStrictStart() |
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInput
accept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
private static final java.lang.String STAR
protected final com.google.common.collect.ImmutableMap<java.lang.String,RexNode> measures
protected final RexNode pattern
protected final boolean strictStart
protected final boolean strictEnd
protected final boolean allRows
protected final RexNode after
protected final com.google.common.collect.ImmutableMap<java.lang.String,RexNode> patternDefinitions
protected final java.util.Set<Match.RexMRAggCall> aggregateCalls
protected final java.util.Map<java.lang.String,java.util.SortedSet<Match.RexMRAggCall>> aggregateCallsPreVar
protected final com.google.common.collect.ImmutableMap<java.lang.String,java.util.SortedSet<java.lang.String>> subsets
protected final java.util.List<RexNode> partitionKeys
protected final RelCollation orderKeys
protected final RexNode interval
protected Match(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RelDataType rowType, RexNode pattern, boolean strictStart, boolean strictEnd, java.util.Map<java.lang.String,RexNode> patternDefinitions, java.util.Map<java.lang.String,RexNode> measures, RexNode after, java.util.Map<java.lang.String,? extends java.util.SortedSet<java.lang.String>> subsets, boolean allRows, java.util.List<RexNode> partitionKeys, RelCollation orderKeys, RexNode interval)
cluster
- ClustertraitSet
- Trait setinput
- Input relational expressionrowType
- Row typepattern
- Regular expression that defines pattern variablesstrictStart
- Whether it is a strict start patternstrictEnd
- Whether it is a strict end patternpatternDefinitions
- Pattern definitionsmeasures
- Measure definitionsafter
- After match definitionssubsets
- Subsets of pattern variablesallRows
- Whether all rows per match (false means one row per match)partitionKeys
- Partition by columnsorderKeys
- Order by columnsinterval
- Interval definition, null if WITHIN clause is not definedprivate static <K extends java.lang.Comparable<K>,V> com.google.common.collect.ImmutableSortedMap<K,java.util.SortedSet<V>> copyMap(java.util.Map<K,? extends java.util.SortedSet<V>> map)
public com.google.common.collect.ImmutableMap<java.lang.String,RexNode> getMeasures()
public RexNode getAfter()
public RexNode getPattern()
public boolean isStrictStart()
public boolean isStrictEnd()
public boolean isAllRows()
public com.google.common.collect.ImmutableMap<java.lang.String,RexNode> getPatternDefinitions()
public com.google.common.collect.ImmutableMap<java.lang.String,java.util.SortedSet<java.lang.String>> getSubsets()
public java.util.List<RexNode> getPartitionKeys()
public RelCollation getOrderKeys()
public RexNode getInterval()
public abstract Match copy(RelNode input, RelDataType rowType, RexNode pattern, boolean strictStart, boolean strictEnd, java.util.Map<java.lang.String,RexNode> patternDefinitions, java.util.Map<java.lang.String,RexNode> measures, RexNode after, java.util.Map<java.lang.String,? extends java.util.SortedSet<java.lang.String>> subsets, boolean allRows, java.util.List<RexNode> partitionKeys, RelCollation orderKeys, RexNode interval)
public RelNode copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
RelNode
Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy
in interface RelNode
copy
in class AbstractRelNode
traitSet
- Trait setinputs
- Inputspublic RelWriter explainTerms(RelWriter pw)
AbstractRelNode
super.explainTerms
, then call the
RelWriter.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms
in class SingleRel
pw
- Plan writerCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.