Class Sort

    • Field Detail

      • fieldExps

        protected final com.google.common.collect.ImmutableList<RexNode> fieldExps
      • offset

        public final RexNode offset
      • fetch

        public final RexNode fetch
    • Constructor Detail

      • Sort

        public Sort​(RelOptCluster cluster,
                    RelTraitSet traits,
                    RelNode child,
                    RelCollation collation)
        Creates a Sort.
        Parameters:
        cluster - Cluster this relational expression belongs to
        traits - Traits
        child - input relational expression
        collation - array of sort specifications
      • Sort

        public Sort​(RelOptCluster cluster,
                    RelTraitSet traits,
                    RelNode child,
                    RelCollation collation,
                    RexNode offset,
                    RexNode fetch)
        Creates a Sort.
        Parameters:
        cluster - Cluster this relational expression belongs to
        traits - Traits
        child - input relational expression
        collation - array of sort specifications
        offset - Expression for number of rows to discard before returning first row
        fetch - Expression for number of rows to fetch
      • Sort

        public Sort​(RelInput input)
        Creates a Sort by parsing serialized output.
    • Method Detail

      • copy

        public final Sort 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
      • getChildExps

        public java.util.List<RexNode> getChildExps()
        Description copied from interface: RelNode
        Returns a list of this relational expression's child expressions. (These are scalar expressions, and so do not include the relational inputs that are returned by RelNode.getInputs().

        The caller should treat the list as unmodifiable; typical implementations will return an immutable list. If there are no child expressions, returns an empty list, not null.

        Specified by:
        getChildExps in interface RelNode
        Overrides:
        getChildExps in class AbstractRelNode
        Returns:
        List of this relational expression's child expressions
        See Also:
        RelNode.accept(org.apache.calcite.rex.RexShuttle)
      • accept

        public RelNode accept​(RexShuttle shuttle)
        Description copied from interface: RelNode
        Accepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created.
        Specified by:
        accept in interface RelNode
        Overrides:
        accept in class AbstractRelNode
        Parameters:
        shuttle - Shuttle
        Returns:
        A copy of this node incorporating changes made by the shuttle to this node's children
      • getCollation

        public RelCollation getCollation()
        Returns the array of RelFieldCollations asked for by the sort specification, from most significant to least significant.

        See also RelMetadataQuery.collations(RelNode), which lists all known collations. For example, ORDER BY time_id might also be sorted by the_year, the_month because of a known monotonicity constraint among the columns. getCollation would return [time_id] and collations would return [ [time_id], [the_year, the_month] ].

      • getCollationList

        public java.util.List<RelCollation> getCollationList()
        Description copied from interface: RelNode
        Returns a description of the physical ordering (or orderings) of this relational expression. Never null.
        Specified by:
        getCollationList in interface RelNode
        Overrides:
        getCollationList in class AbstractRelNode
        Returns:
        Description of the physical ordering (or orderings) of this relational expression. Never null