|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.plan.PlanVisitor<LogicalOperator,LogicalPlan>
org.apache.pig.impl.logicalLayer.LOVisitor
org.apache.pig.impl.logicalLayer.validators.TypeCheckingVisitor
public class TypeCheckingVisitor
Visitor for type checking. For simplicity of the first implementation, we throw exception immediately once something doesn't look alright. This is not quite smart e.g. if the plan has another unrelated branch.
Field Summary | |
---|---|
static MultiMap<Byte,Byte> |
castLookup
|
Fields inherited from class org.apache.pig.impl.plan.PlanVisitor |
---|
mCurrentWalker, mPlan |
Constructor Summary | |
---|---|
TypeCheckingVisitor(LogicalPlan plan,
CompilationMessageCollector messageCollector)
|
Method Summary | |
---|---|
byte |
getAtomicGroupByType(LOCogroup cg)
This can be used to get the merged type of output group col only when the group col is of atomic type TODO: This doesn't work with group by complex type |
Schema |
getTupleGroupBySchema(LOCogroup cg)
|
static boolean |
schemaEqualsForMatching(Schema inputSchema,
Schema udfSchema,
boolean ignoreByteArrays)
Compare two schemas for equality for argument matching purposes. |
protected void |
visit(ExpressionOperator eOp)
|
void |
visit(LOAdd binOp)
|
void |
visit(LOAnd binOp)
|
protected void |
visit(LOBinCond binCond)
For Bincond, lhsOp and rhsOp must have the same output type or both sides have to be number |
protected void |
visit(LOCast cast)
For Basic Types: 0) Casting to itself is always ok 1) Casting from number to number is always ok 2) ByteArray to anything is ok 3) (number or chararray) to (bytearray or chararray) is ok For Composite Types: Recursively traverse the schemas till you get a basic type |
protected void |
visit(LOCogroup cg)
COGroup All group by cols from all inputs have to be of the same type |
protected void |
visit(LOConst cs)
LOConst. |
protected void |
visit(LOCross cs)
Return concatenated of all fields from all input operators If one of the inputs have no schema then we cannot construct the output schema. |
protected void |
visit(LODistinct op)
LODistinct, output schema should be the same as input |
void |
visit(LODivide binOp)
|
void |
visit(LOEqual binOp)
|
protected void |
visit(LOFilter filter)
The schema of filter output will be the same as filter input |
protected void |
visit(LOForEach f)
Output schema of LOForEach is a tuple schma which is the output of all inner plans Flatten also has to be taken care on in here |
protected void |
visit(LOFRJoin frj)
Mimics the type checking of LOCogroup |
protected void |
visit(LogicalOperator lOp)
|
void |
visit(LOGreaterThan binOp)
|
void |
visit(LOGreaterThanEqual binOp)
|
void |
visit(LOIsNull uniOp)
|
void |
visit(LOLesserThan binOp)
|
void |
visit(LOLesserThanEqual binOp)
|
protected void |
visit(LOLimit op)
|
protected void |
visit(LOLoad load)
|
void |
visit(LOMapLookup map)
|
void |
visit(LOMod binOp)
|
void |
visit(LOMultiply binOp)
|
void |
visit(LONegative uniOp)
|
void |
visit(LONot uniOp)
|
void |
visit(LONotEqual binOp)
|
void |
visit(LOOr binOp)
|
protected void |
visit(LOProject pj)
|
protected void |
visit(LORegexp rg)
LORegexp expects CharArray as input Itself always returns Boolean |
protected void |
visit(LOSort s)
The schema of sort output will be the same as sort input. |
protected void |
visit(LOSplit split)
The schema of split output will be the same as split input |
protected void |
visit(LOSplitOutput op)
|
protected void |
visit(LOStore store)
|
void |
visit(LOSubtract binOp)
|
protected void |
visit(LOUnion u)
|
protected void |
visit(LOUserFunc func)
Iterate over each expression that is part of the function argument list |
protected void |
visit(UnaryExpressionOperator uniOp)
Currently, there are two unaryOps: Neg and Not. |
Methods inherited from class org.apache.pig.impl.logicalLayer.LOVisitor |
---|
visit, visit, visit |
Methods inherited from class org.apache.pig.impl.plan.PlanVisitor |
---|
getPlan, popWalker, pushWalker, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static MultiMap<Byte,Byte> castLookup
Constructor Detail |
---|
public TypeCheckingVisitor(LogicalPlan plan, CompilationMessageCollector messageCollector)
Method Detail |
---|
protected void visit(ExpressionOperator eOp) throws VisitorException
visit
in class LOVisitor
eOp
- the logical expression operator that has to be visited
VisitorException
protected void visit(LogicalOperator lOp) throws VisitorException
visit
in class LOVisitor
lOp
- the logical operator that has to be visited
VisitorException
protected void visit(LOProject pj) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LOConst cs) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOMapLookup map) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LORegexp rg) throws VisitorException
visit
in class LOVisitor
rg
-
VisitorException
public void visit(LOAnd binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOOr binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOMultiply binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LODivide binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOAdd binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOSubtract binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOGreaterThan binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOGreaterThanEqual binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOLesserThan binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOLesserThanEqual binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOEqual binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LONotEqual binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOMod binOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LONegative uniOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LONot uniOp) throws VisitorException
visit
in class LOVisitor
VisitorException
public void visit(LOIsNull uniOp) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(UnaryExpressionOperator uniOp) throws VisitorException
visit
in class LOVisitor
uniOp
- the logical unary operator that has to be visited
VisitorException
protected void visit(LOUserFunc func) throws VisitorException
LOVisitor
visit
in class LOVisitor
func
- the user defined function
VisitorException
public static boolean schemaEqualsForMatching(Schema inputSchema, Schema udfSchema, boolean ignoreByteArrays)
inputSchema
- udfSchema
- ignoreByteArrays
-
protected void visit(LOBinCond binCond) throws VisitorException
visit
in class LOVisitor
binCond
- the logical binCond operator that has to be visited
VisitorException
protected void visit(LOCast cast) throws VisitorException
visit
in class LOVisitor
cast
- the logical cast operator that has to be visited
VisitorException
protected void visit(LOUnion u) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LOSplitOutput op) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LODistinct op) throws VisitorException
visit
in class LOVisitor
op
-
VisitorException
protected void visit(LOLimit op) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LOCross cs) throws VisitorException
visit
in class LOVisitor
cs
-
VisitorException
protected void visit(LOSort s) throws VisitorException
visit
in class LOVisitor
s
- the logical sort operator that has to be visited
VisitorException
protected void visit(LOFilter filter) throws VisitorException
visit
in class LOVisitor
filter
- the logical filter operator that has to be visited
VisitorException
protected void visit(LOSplit split) throws VisitorException
visit
in class LOVisitor
split
- the logical split operator that has to be visited
VisitorException
protected void visit(LOFRJoin frj) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LOCogroup cg) throws VisitorException
visit
in class LOVisitor
cg
- the logical cogroup operator that has to be visited
VisitorException
public byte getAtomicGroupByType(LOCogroup cg) throws VisitorException
VisitorException
public Schema getTupleGroupBySchema(LOCogroup cg) throws VisitorException
VisitorException
protected void visit(LOForEach f) throws VisitorException
visit
in class LOVisitor
f
- the logical foreach operator that has to be visited
VisitorException
protected void visit(LOLoad load) throws VisitorException
visit
in class LOVisitor
VisitorException
protected void visit(LOStore store)
visit
in class LOVisitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |