public class ProjectExpression extends ColumnExpression
fieldSchema, uidOnlyFieldSchema
Constructor and Description |
---|
ProjectExpression(OperatorPlan plan,
int inputNum,
int colNum,
LogicalRelationalOperator attachedRelationalOp)
Adds projection to the plan.
|
ProjectExpression(OperatorPlan plan,
int inputNum,
LogicalRelationalOperator attachedRelationalOp)
Constructor for range projection
Adds projection to the plan.
|
ProjectExpression(OperatorPlan plan,
int inputNum,
java.lang.String alias,
Operator projectedOp,
LogicalRelationalOperator attachedRelationalOp)
Adds projection to the plan.
|
ProjectExpression(ProjectExpression projExpr,
OperatorPlan plan)
like a copy constructor, but with a plan argument
|
Modifier and Type | Method and Description |
---|---|
void |
accept(PlanVisitor v)
Accept a visitor at this node in the graph.
|
LogicalExpression |
deepCopy(LogicalExpressionPlan lgExpPlan)
Create the deep copy of this expression and add that into the passed
LogicalExpressionPlan Return the copy of this expression with updated
logical expression plan.
|
LogicalRelationalOperator |
findReferent()
Find the LogicalRelationalOperator that this projection refers to.
|
LogicalRelationalOperator |
getAttachedRelationalOp() |
java.lang.String |
getColAlias() |
int |
getColNum()
Column number this project references.
|
int |
getEndCol() |
LogicalSchema.LogicalFieldSchema |
getFieldSchema()
Get the field schema for the output of this expression operator.
|
int |
getInputNum()
Input number this project references.
|
Operator |
getProjectedOperator() |
int |
getStartCol() |
byte |
getType()
Get the data type for this expression.
|
boolean |
isEqual(Operator other)
This is like a shallow equals comparison.
|
boolean |
isProjectStar() |
boolean |
isRangeOrStarProject() |
boolean |
isRangeProject() |
void |
setAttachedRelationalOp(LogicalRelationalOperator attachedRelationalOp) |
void |
setColNum(int colNum)
Set the column number for this project.
|
void |
setColumnNumberFromAlias()
If there is an alias, finds the column number from it.
|
void |
setEndAlias(java.lang.String endAlias) |
void |
setEndCol(int endCol) |
void |
setInputNum(int inputNum) |
void |
setStartAlias(java.lang.String startAlias) |
void |
setStartCol(int startCol) |
java.lang.String |
toString() |
getNextUid, hasFieldSchema, neverUseForRealSetFieldSchema, resetFieldSchema, resetNextUid, resetUid
annotate, getAnnotation, getLocation, getName, getPlan, removeAnnotation, setLocation, setPlan
public ProjectExpression(OperatorPlan plan, int inputNum, int colNum, LogicalRelationalOperator attachedRelationalOp)
plan
- LogicalExpressionPlan this projection will be a part ofinputNum
- Input number this project references.colNum
- Column number this project references.attachedRelationalOp
- public ProjectExpression(OperatorPlan plan, int inputNum, java.lang.String alias, Operator projectedOp, LogicalRelationalOperator attachedRelationalOp)
plan
- inputNum
- alias
- attachedRelationalOp
- FrontendException
public ProjectExpression(OperatorPlan plan, int inputNum, LogicalRelationalOperator attachedRelationalOp)
plan
- inputNum
- attachedRelationalOp
- public ProjectExpression(ProjectExpression projExpr, OperatorPlan plan)
projExpr
- plan
- public void setColumnNumberFromAlias() throws FrontendException
FrontendException
- if there is no such aliaspublic void accept(PlanVisitor v) throws FrontendException
Operator
accept
in class Operator
v
- Visitor to accept.FrontendException
public int getInputNum()
public void setInputNum(int inputNum)
public int getColNum()
public java.lang.String getColAlias()
public Operator getProjectedOperator()
public void setColNum(int colNum)
colNum
- new column number for projectionpublic boolean isProjectStar()
public boolean isRangeProject()
public boolean isRangeOrStarProject()
public LogicalSchema.LogicalFieldSchema getFieldSchema() throws FrontendException
LogicalExpression
getFieldSchema
in class LogicalExpression
FrontendException
public LogicalRelationalOperator findReferent() throws FrontendException
FrontendException
public boolean isEqual(Operator other) throws FrontendException
Operator
isEqual
in class Operator
FrontendException
public java.lang.String toString()
toString
in class LogicalExpression
public LogicalRelationalOperator getAttachedRelationalOp()
public void setAttachedRelationalOp(LogicalRelationalOperator attachedRelationalOp)
public byte getType() throws FrontendException
LogicalExpression
getType
in class LogicalExpression
FrontendException
public int getStartCol()
public void setStartCol(int startCol)
startCol
- the startCol to setpublic int getEndCol()
public void setEndCol(int endCol)
endCol
- the endCol to setpublic void setStartAlias(java.lang.String startAlias) throws FrontendException
startAlias
- FrontendException
public void setEndAlias(java.lang.String endAlias) throws FrontendException
endAlias
- FrontendException
public LogicalExpression deepCopy(LogicalExpressionPlan lgExpPlan) throws FrontendException
LogicalExpression
deepCopy
in class LogicalExpression
lgExpPlan
- LogicalExpressionPlan in which this expression will be added.FrontendException
Copyright © 2007-2017 The Apache Software Foundation