[
https://issues.apache.org/jira/browse/DRILL-2852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14908666#comment-14908666
]
Victoria Markman commented on DRILL-2852:
-----------------------------------------
Verified fixed in 1.2.0
#Thu Sep 24 00:27:47 UTC 2015
git.commit.id.abbrev=d2caa62
Plan and result for this query are correct:
{code}
0: jdbc:drill:schema=dfs> explain plan for select * from v1_drill_2852 where
myyear = '1995' and o_totalprice < 1000.0;
+------+------+
| text | json |
+------+------+
| 00-00 Screen
00-01 Project(myyear=[CAST($0):VARCHAR(100) CHARACTER SET "ISO-8859-1"
COLLATE "ISO-8859-1$en_US$primary"], o_totalprice=[$1])
00-02 SelectionVectorRemover
00-03 Filter(condition=[AND(=(CAST($0):VARCHAR(100) CHARACTER SET
"ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary", '1995'), <($1, 1000.0))])
00-04 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath
[path=maprfs:/drill/testdata/partition_pruning/dfs/orders/1995/03.parquet]],
selectionRoot=maprfs:/drill/testdata/partition_pruning/dfs/orders, numFiles=1,
columns=[`dir0`, `o_totalprice`]]])
{code}
This test will be included in the test suite for DRILL-3690
> CASTing the column 'dir0' in view causes partition pruning to fail
> -------------------------------------------------------------------
>
> Key: DRILL-2852
> URL: https://issues.apache.org/jira/browse/DRILL-2852
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 0.8.0
> Reporter: Aman Sinha
> Assignee: Aman Sinha
> Fix For: 1.2.0
>
>
> 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.
> {code}
> 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;
> {code}
> Failure stack trace:
> {code}
> 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]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)