public static class Nodes.CoreCompiler extends RelVisitor
Interpreter.CompilerImpl
that knows how to handle the core logical
RelNode
s.Modifier and Type | Field and Description |
---|---|
protected Interpreter |
interpreter |
protected Node |
node |
protected RelNode |
rel |
protected RelNode |
rootRel |
Modifier and Type | Method and Description |
---|---|
RelDataType |
combinedRowType(List<RelNode> inputs) |
Scalar |
compile(List<RexNode> nodes,
RelDataType inputRowType)
Compiles an expression to an executable form.
|
Context |
createContext() |
void |
enumerable(RelNode rel,
Enumerable<Row> rowEnumerable)
Tells the interpreter that a given relational expression wishes to
give its output as an enumerable.
|
DataContext |
getDataContext() |
void |
rewrite(RelNode r)
Fallback rewrite method.
|
Sink |
sink(RelNode rel)
Creates a Sink for a relational expression to write into.
|
Source |
source(RelNode rel,
int ordinal) |
void |
visit(Aggregate agg) |
void |
visit(Bindables.BindableTableScan scan) |
void |
visit(Filter filter) |
void |
visit(Join join) |
void |
visit(Project project) |
void |
visit(RelNode p,
int ordinal,
RelNode parent)
Visits a node during a traversal.
|
void |
visit(Sort sort) |
void |
visit(TableScan scan) |
void |
visit(Union union) |
void |
visit(Values value) |
void |
visit(Window window) |
go, replaceRoot
protected final Interpreter interpreter
protected RelNode rootRel
protected RelNode rel
protected Node node
public void visit(Aggregate agg)
public void visit(Filter filter)
public void visit(Project project)
public void visit(Values value)
public void visit(TableScan scan)
public void visit(Bindables.BindableTableScan scan)
public void visit(Sort sort)
public void visit(Union union)
public void visit(Join join)
public void visit(Window window)
public void visit(RelNode p, int ordinal, RelNode parent)
RelVisitor
visit
in class RelVisitor
p
- Node to visitordinal
- Ordinal of node within its parentparent
- Parent of the node, or null if it is the root of the
traversalpublic void rewrite(RelNode r)
public Scalar compile(List<RexNode> nodes, RelDataType inputRowType)
Compiler
public RelDataType combinedRowType(List<RelNode> inputs)
combinedRowType
in interface Compiler
public Sink sink(RelNode rel)
Compiler
This method is generally called from the constructor of a Node
.
But a constructor could instead call
Compiler.enumerable(RelNode, Enumerable)
.
public void enumerable(RelNode rel, Enumerable<Row> rowEnumerable)
Compiler
This is as opposed to the norm, where a relational expression calls
Compiler.sink(RelNode)
, then its Node.run()
method writes into that
sink.
enumerable
in interface Compiler
rel
- Relational expressionrowEnumerable
- Contents of relational expressionpublic Context createContext()
createContext
in interface Compiler
public DataContext getDataContext()
getDataContext
in interface Compiler
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.