Package org.apache.calcite.piglet
Class Handler
- java.lang.Object
-
- org.apache.calcite.piglet.Handler
-
public class Handler extends java.lang.Object
Walks over a Piglet AST and calls the corresponding methods in aPigRelBuilder
.
-
-
Field Summary
Fields Modifier and Type Field Description private PigRelBuilder
builder
private java.util.Map<java.lang.String,RelNode>
map
-
Constructor Summary
Constructors Constructor Description Handler(PigRelBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.google.common.collect.ImmutableList<RexLiteral>
bag(java.util.List<Ast.Node> nodeList, RelDataType type)
protected void
dump(RelNode rel)
Executes a relational expression and prints the output.Handler
handle(Ast.Node node)
Creates relational expressions for a given AST node.private RexLiteral
item(Ast.Node node, RelDataType type)
private static SqlOperator
op(Ast.Op op)
private void
register(java.lang.String name)
Assigns the current relational expression to a given name.private com.google.common.collect.ImmutableList<RexNode>
toRex(java.lang.Iterable<Ast.Node> operands)
private RexNode
toRex(Ast.Node exp)
private void
toSortRex(java.util.List<RexNode> nodes, Pair<Ast.Identifier,Ast.Direction> pair)
private RelDataType
toType(Ast.BagType type)
private RelDataType
toType(Ast.MapType type)
private RelDataType
toType(Ast.ScalarType type)
private RelDataType
toType(Ast.Schema schema)
private RelDataType
toType(Ast.TupleType type)
private RelDataType
toType(Ast.Type type)
private com.google.common.collect.ImmutableList<RexLiteral>
tuple(java.util.List<Ast.Node> nodeList, RelDataType rowType)
private com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>>
tuples(Ast.ValuesStmt valuesStmt, RelDataType rowType)
-
-
-
Field Detail
-
builder
private final PigRelBuilder builder
-
map
private final java.util.Map<java.lang.String,RelNode> map
-
-
Constructor Detail
-
Handler
public Handler(PigRelBuilder builder)
-
-
Method Detail
-
dump
protected void dump(RelNode rel)
Executes a relational expression and prints the output.The default implementation does nothing.
- Parameters:
rel
- Relational expression
-
tuples
private com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples(Ast.ValuesStmt valuesStmt, RelDataType rowType)
-
tuple
private com.google.common.collect.ImmutableList<RexLiteral> tuple(java.util.List<Ast.Node> nodeList, RelDataType rowType)
-
bag
private com.google.common.collect.ImmutableList<RexLiteral> bag(java.util.List<Ast.Node> nodeList, RelDataType type)
-
item
private RexLiteral item(Ast.Node node, RelDataType type)
-
toType
private RelDataType toType(Ast.Schema schema)
-
toType
private RelDataType toType(Ast.Type type)
-
toType
private RelDataType toType(Ast.ScalarType type)
-
toType
private RelDataType toType(Ast.BagType type)
-
toType
private RelDataType toType(Ast.MapType type)
-
toType
private RelDataType toType(Ast.TupleType type)
-
toSortRex
private void toSortRex(java.util.List<RexNode> nodes, Pair<Ast.Identifier,Ast.Direction> pair)
-
op
private static SqlOperator op(Ast.Op op)
-
toRex
private com.google.common.collect.ImmutableList<RexNode> toRex(java.lang.Iterable<Ast.Node> operands)
-
register
private void register(java.lang.String name)
Assigns the current relational expression to a given name.
-
-