Class SimpleRexRemap

java.lang.Object
org.apache.drill.exec.planner.index.SimpleRexRemap

public class SimpleRexRemap extends Object
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.
  • 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

      public SimpleRexRemap setExpressionMap(Map<LogicalExpression,LogicalExpression> exprMap)
      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 rewritten
      mapRexToExpr - 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

      public static String getFullPath(PathSegment pathSeg)