Package org.apache.calcite.adapter.pig
Class PigFilter
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.SingleRel
-
- org.apache.calcite.rel.core.Filter
-
- org.apache.calcite.adapter.pig.PigFilter
-
- All Implemented Interfaces:
java.lang.Cloneable
,PigRel
,RelOptNode
,RelNode
public class PigFilter extends Filter implements PigRel
Implementation ofFilter
inPig calling convention
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.adapter.pig.PigRel
PigRel.Implementor
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Fields inherited from interface org.apache.calcite.adapter.pig.PigRel
CONVENTION
-
-
Constructor Summary
Constructors Constructor Description PigFilter(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode condition)
Creates a PigFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
containsOnlyConjunctions(RexNode condition)
Filter
copy(RelTraitSet traitSet, RelNode input, RexNode condition)
private java.lang.String
getLiteralAsString(RexLiteral literal)
TODO: do proper literal to string conversion + escapingprivate java.lang.String
getPigFilterStatement(PigRel.Implementor implementor)
Generates Pig Latin filtering statements, for exampleprivate java.lang.String
getSingleFilterCondition(PigRel.Implementor implementor, java.lang.String op, RexCall call)
private java.lang.String
getSingleFilterCondition(PigRel.Implementor implementor, RexNode node)
RelOptTable
getTable()
Override this method so it looks down the tree to find the table this node is acting on.void
implement(PigRel.Implementor implementor)
Converts this node to a Pig Latin statement.-
Methods inherited from class org.apache.calcite.rel.core.Filter
accept, computeSelfCost, copy, estimateFilteredRows, estimateFilteredRows, estimateRowCount, explainTerms, getChildExps, getCondition, isValid
-
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInput
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.rel.RelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
-
Methods inherited from interface org.apache.calcite.plan.RelOptNode
getCluster, getDescription, getDigest, getId, getTraitSet
-
-
-
-
Constructor Detail
-
PigFilter
public PigFilter(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode condition)
Creates a PigFilter.
-
-
Method Detail
-
copy
public Filter copy(RelTraitSet traitSet, RelNode input, RexNode condition)
-
implement
public void implement(PigRel.Implementor implementor)
Description copied from interface:PigRel
Converts this node to a Pig Latin statement.
-
getTable
public RelOptTable getTable()
Override this method so it looks down the tree to find the table this node is acting on.- Specified by:
getTable
in interfaceRelNode
- Overrides:
getTable
in classAbstractRelNode
- Returns:
- If this relational expression represents an access to a table, returns that table, otherwise returns null
-
getPigFilterStatement
private java.lang.String getPigFilterStatement(PigRel.Implementor implementor)
Generates Pig Latin filtering statements, for exampletable = FILTER table BY score > 2.0;
-
getSingleFilterCondition
private java.lang.String getSingleFilterCondition(PigRel.Implementor implementor, RexNode node)
-
getSingleFilterCondition
private java.lang.String getSingleFilterCondition(PigRel.Implementor implementor, java.lang.String op, RexCall call)
-
containsOnlyConjunctions
private boolean containsOnlyConjunctions(RexNode condition)
-
getLiteralAsString
private java.lang.String getLiteralAsString(RexLiteral literal)
TODO: do proper literal to string conversion + escaping
-
-