Class Nodes.CoreCompiler

All Implemented Interfaces:
Compiler, ReflectiveVisitor
Enclosing class:

public static class Nodes.CoreCompiler extends RelVisitor
Extension to Interpreter.CompilerImpl that knows how to handle the core logical RelNodes.
  • Field Details

    • interpreter

      @NotOnlyInitialized protected final Interpreter interpreter
    • rootRel

      protected @Nullable RelNode rootRel
    • rel

      protected @Nullable RelNode rel
    • node

      protected @Nullable Node node
  • Method Details

    • visit

      public void visit(Aggregate agg)
    • visit

      public void visit(Filter filter)
    • visit

      public void visit(Project project)
    • visit

      public void visit(Values value)
    • visit

      public void visit(TableScan scan)
    • visit

      public void visit(Bindables.BindableTableScan scan)
    • visit

      public void visit(TableFunctionScan functionScan)
    • visit

      public void visit(Sort sort)
    • visit

      public void visit(SetOp setOp)
    • visit

      public void visit(Join join)
    • visit

      public void visit(Window window)
    • visit

      public void visit(Match match)
    • visit

      public void visit(Collect collect)
    • visit

      public void visit(Uncollect uncollect)
    • visit

      public void visit(RelNode p, int ordinal, @Nullable RelNode parent)
      Description copied from class: RelVisitor
      Visits a node during a traversal.
      visit in class RelVisitor
      p - Node to visit
      ordinal - Ordinal of node within its parent
      parent - Parent of the node, or null if it is the root of the traversal
    • rewrite

      public void rewrite(RelNode r)
      Fallback rewrite method.

      Overriding methods (each with a different sub-class of RelNode as its argument type) sets the rel field if intends to rewrite.

    • compile

      public Scalar compile(List<RexNode> nodes, @Nullable RelDataType inputRowType)
      Description copied from interface: Compiler
      Compiles an expression to an executable form.
      Specified by:
      compile in interface Compiler
    • combinedRowType

      public RelDataType combinedRowType(List<RelNode> inputs)
      Specified by:
      combinedRowType in interface Compiler
    • source

      public Source source(RelNode rel, int ordinal)
      Specified by:
      source in interface Compiler
    • sink

      public Sink sink(RelNode rel)
      Description copied from interface: Compiler
      Creates a Sink for a relational expression to write into.

      This method is generally called from the constructor of a Node. But a constructor could instead call Compiler.enumerable(RelNode, Enumerable).

      Specified by:
      sink in interface Compiler
      rel - Relational expression
    • enumerable

      public void enumerable(RelNode rel, Enumerable<Row> rowEnumerable)
      Description copied from interface: Compiler
      Tells the interpreter that a given relational expression wishes to give its output as an enumerable.

      This is as opposed to the norm, where a relational expression calls Compiler.sink(RelNode), then its method writes into that sink.

      Specified by:
      enumerable in interface Compiler
      rel - Relational expression
      rowEnumerable - Contents of relational expression
    • createContext

      public Context createContext()
      Specified by:
      createContext in interface Compiler
    • getDataContext

      public DataContext getDataContext()
      Specified by:
      getDataContext in interface Compiler