Class SimpleRexRemap
java.lang.Object
org.apache.drill.exec.planner.index.SimpleRexRemap
Rewrite RexNode with these policies:
1) field renamed. The input field was named differently in index table,
2) field is in different position of underlying rowtype
TODO: 3) certain operator needs rewriting. e.g. CAST function
This class for now applies to only filter on scan, for filter-on-project-on-scan. A stack of
rowType is required.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This class go through the RexNode, collect all the fieldNames, mark starting positions(RexNode) of fields so this information can be used later e,.g.static class
-
Constructor Summary
ConstructorDescriptionSimpleRexRemap
(org.apache.calcite.rel.RelNode origRel, org.apache.calcite.rel.type.RelDataType newRowType, org.apache.calcite.rex.RexBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFullPath
(PathSegment pathSeg) org.apache.calcite.rex.RexNode
rewrite
(org.apache.calcite.rex.RexNode expr) org.apache.calcite.rex.RexNode
rewriteEqualOnCharToLike
(org.apache.calcite.rex.RexNode expr, Map<org.apache.calcite.rex.RexNode, LogicalExpression> equalOnCastCharExprs) org.apache.calcite.rex.RexNode
rewriteWithMap
(org.apache.calcite.rex.RexNode srcRex, Map<org.apache.calcite.rex.RexNode, LogicalExpression> mapRexToExpr) Set the map of src expression to target expression, expressions not in the map do not have assigned destinations
-
Constructor Details
-
SimpleRexRemap
public SimpleRexRemap(org.apache.calcite.rel.RelNode origRel, org.apache.calcite.rel.type.RelDataType newRowType, org.apache.calcite.rex.RexBuilder builder)
-
-
Method Details
-
setExpressionMap
Set the map of src expression to target expression, expressions not in the map do not have assigned destinations- Parameters:
exprMap
-- Returns:
-
rewriteEqualOnCharToLike
public org.apache.calcite.rex.RexNode rewriteEqualOnCharToLike(org.apache.calcite.rex.RexNode expr, Map<org.apache.calcite.rex.RexNode, LogicalExpression> equalOnCastCharExprs) -
rewriteWithMap
public org.apache.calcite.rex.RexNode rewriteWithMap(org.apache.calcite.rex.RexNode srcRex, Map<org.apache.calcite.rex.RexNode, LogicalExpression> mapRexToExpr) - Parameters:
srcRex
- the source RexNode to be rewrittenmapRexToExpr
- a map of rex->logical expression to guide what rex to rewrite- Returns:
- the RexNode after rewriting
-
rewrite
public org.apache.calcite.rex.RexNode rewrite(org.apache.calcite.rex.RexNode expr) -
getFullPath
-