Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2852

CASTing the column 'dir0' in view causes partition pruning to fail

    XMLWordPrintableJSON

Details

    Description

      If the partition column 'dir0' is CAST inside a view and the query has a filter on that column, then partition pruning interpreter evaluator encounters an AssertionError.

      Table data in the example below is from test/resources/multilevel/parquet.

      create view dfs.tmp.myview2 as select cast(dir0 as varchar(100)) as myyear, dir1 as myquarter, o_totalprice from `multilevel/parquet` ;
      
      select * from dfs.tmp.myview2 where myyear = '1995' and myquarter = 'Q2' and o_totalprice < 40000.0;
      

      Failure stack trace:

      Caused by: java.lang.AssertionError: Internal error: Error while applying rule PruneScanRule:Filter_On_Project,
      ...
      <skip>
      
      Caused by: java.lang.AssertionError: null
              at org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.isBitOn(InterpreterEvaluator.java:490) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitBooleanAnd(InterpreterEvaluator.java:434) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitBooleanOperator(InterpreterEvaluator.java:332) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitBooleanOperator(InterpreterEvaluator.java:147) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.common.expression.BooleanOperator.accept(BooleanOperator.java:36) ~[drill-common-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator.evaluate(InterpreterEvaluator.java:80) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
              at org.apache.drill.exec.planner.logical.partition.PruneScanRule.doOnMatch(PruneScanRule.java:224) ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
      

      Attachments

        Issue Links

          Activity

            People

              amansinha100 Aman Sinha
              amansinha100 Aman Sinha
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: