Class Sort

    • 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,
                               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
      • 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. This new relation might have a different row-type.
        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
      • isEnforcer

        public boolean isEnforcer()
        Description copied from interface: RelNode
        Indicates whether it is an enforcer operator, e.g. PhysicalSort, PhysicalHashDistribute, etc. As an enforcer, the operator must be created only when required traitSet is not satisfied by its input.
        Specified by:
        isEnforcer in interface RelNode
        Overrides:
        isEnforcer in class AbstractRelNode
        Returns:
        Whether it is an enforcer operator
      • 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] ].

      • getSortExps

        public List<RexNode> getSortExps()
        Returns the sort expressions.