Class LogicalCalc

All Implemented Interfaces:
Cloneable, RelOptNode, Hintable, RelNode

public final class LogicalCalc extends Calc
A relational expression which computes project expressions and also filters.

This relational expression combines the functionality of LogicalProject and LogicalFilter. It should be created in the later stages of optimization, by merging consecutive LogicalProject and LogicalFilter nodes together.

The following rules relate to LogicalCalc:

  • Constructor Details

  • Method Details

    • create

      public static LogicalCalc create(RelNode input, RexProgram program)
    • copy

      public LogicalCalc copy(RelTraitSet traitSet, RelNode child, RexProgram program)
      Description copied from class: Calc
      Creates a copy of this Calc.
      Specified by:
      copy in class Calc
      Parameters:
      traitSet - Traits
      child - Input relation
      program - Calc program
      Returns:
      New Calc if any parameter differs from the value of this Calc, or just this if all the parameters are the same
      See Also:
    • collectVariablesUsed

      public void collectVariablesUsed(Set<CorrelationId> variableSet)
      Description copied from interface: RelNode
      Collects variables known to be used by this expression or its descendants. By default, no such information is available and must be derived by analyzing sub-expressions, but some optimizer implementations may insert special expressions which remember such information.
      Specified by:
      collectVariablesUsed in interface RelNode
      Overrides:
      collectVariablesUsed in class AbstractRelNode
      Parameters:
      variableSet - receives variables used
    • withHints

      public RelNode withHints(List<RelHint> hintList)
      Description copied from interface: Hintable
      Returns a new relational expression with the specified hints hintList.

      This method should be overridden by every logical node that supports hint. It is only for internal use during decorrelation.

      Sub-class should return a new copy of the relational expression.

      The default implementation returns the relational expression directly only because not every kind of relational expression supports hints.

      Returns:
      Relational expression with set up hints
    • accept

      public RelNode accept(RelShuttle shuttle)
      Description copied from interface: RelNode
      Accepts a visit from a shuttle.
      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