Class Match

  • All Implemented Interfaces:
    java.lang.Cloneable, RelOptNode, RelNode
    Direct Known Subclasses:
    LogicalMatch

    public abstract class Match
    extends SingleRel
    Relational expression that represent a MATCH_RECOGNIZE node.

    Each output row has the columns defined in the measure statements.

    • Field Detail

      • measures

        protected final com.google.common.collect.ImmutableMap<java.lang.String,​RexNode> measures
      • pattern

        protected final RexNode pattern
      • strictStart

        protected final boolean strictStart
      • strictEnd

        protected final boolean strictEnd
      • allRows

        protected final boolean allRows
      • after

        protected final RexNode after
      • patternDefinitions

        protected final com.google.common.collect.ImmutableMap<java.lang.String,​RexNode> patternDefinitions
      • aggregateCallsPreVar

        protected final java.util.Map<java.lang.String,​java.util.SortedSet<Match.RexMRAggCall>> aggregateCallsPreVar
      • subsets

        protected final com.google.common.collect.ImmutableMap<java.lang.String,​java.util.SortedSet<java.lang.String>> subsets
      • partitionKeys

        protected final java.util.List<RexNode> partitionKeys
      • interval

        protected final RexNode interval
    • Constructor Detail

      • Match

        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.
        Parameters:
        cluster - Cluster
        traitSet - Trait set
        input - Input relational expression
        rowType - Row type
        pattern - Regular expression that defines pattern variables
        strictStart - Whether it is a strict start pattern
        strictEnd - Whether it is a strict end pattern
        patternDefinitions - Pattern definitions
        measures - Measure definitions
        after - After match definitions
        subsets - Subsets of pattern variables
        allRows - Whether all rows per match (false means one row per match)
        partitionKeys - Partition by columns
        orderKeys - Order by columns
        interval - Interval definition, null if WITHIN clause is not defined
    • Method Detail

      • copyMap

        private 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)
        Creates an immutable map of a map of sorted sets.
      • getMeasures

        public com.google.common.collect.ImmutableMap<java.lang.String,​RexNode> getMeasures()
      • getAfter

        public RexNode getAfter()
      • getPattern

        public RexNode getPattern()
      • isStrictStart

        public boolean isStrictStart()
      • isStrictEnd

        public boolean isStrictEnd()
      • isAllRows

        public boolean isAllRows()
      • getPatternDefinitions

        public com.google.common.collect.ImmutableMap<java.lang.String,​RexNode> getPatternDefinitions()
      • getSubsets

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.util.SortedSet<java.lang.String>> getSubsets()
      • getPartitionKeys

        public java.util.List<RexNode> getPartitionKeys()
      • getInterval

        public RexNode getInterval()
      • copy

        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)
      • copy

        public RelNode copy​(RelTraitSet traitSet,
                            java.util.List<RelNode> inputs)
        Description copied from interface: RelNode
        Creates a copy of this relational expression, perhaps changing traits and inputs.

        Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.

        Specified by:
        copy in interface RelNode
        Overrides:
        copy in class AbstractRelNode
        Parameters:
        traitSet - Trait set
        inputs - Inputs
        Returns:
        Copy of this relational expression, substituting traits and inputs