You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Remus Rusanu (JIRA)" <ji...@apache.org> on 2017/03/14 13:07:41 UTC

[jira] [Created] (CALCITE-1695) Not all RexUtil.simplifyXxx code paths carry the provided executor

Remus Rusanu created CALCITE-1695:
-------------------------------------

             Summary: Not all RexUtil.simplifyXxx code paths carry the provided executor
                 Key: CALCITE-1695
                 URL: https://issues.apache.org/jira/browse/CALCITE-1695
             Project: Calcite
          Issue Type: Bug
            Reporter: Remus Rusanu
            Assignee: Remus Rusanu
             Fix For: 1.12.0


CALCITE-1653 resolved some of the issues encountered with different semantics in Hive executor vs. Calcite default executor. When investigating a workaround for CALCITE-1690 I found that there are other code paths that can this the same issue, eg:
{noformat}
	at org.apache.calcite.rex.RexBuilder.makeLiteral(RexBuilder.java:1239)
	at org.apache.calcite.rex.RexBuilder.makeLiteral(RexBuilder.java:1236)
	at org.apache.calcite.rex.RexExecutable.reduce(RexExecutable.java:86)
	at org.apache.calcite.rex.RexExecutorImpl.reduce(RexExecutorImpl.java:128)
	at org.apache.calcite.rex.RexUtil.simplifyCast(RexUtil.java:2450)
	at org.apache.calcite.rex.RexUtil.simplify(RexUtil.java:1633)
	at org.apache.calcite.rex.RexUtil.simplify(RexUtil.java:1587)
	at org.apache.calcite.rex.RexUtil.simplifyList(RexUtil.java:1747)
	at org.apache.calcite.rex.RexUtil.simplifyComparison(RexUtil.java:1658)
	at org.apache.calcite.rex.RexUtil.simplify(RexUtil.java:1648)
	at org.apache.calcite.rex.RexUtil$ExprSimplifier.visitCall(RexUtil.java:3051)
	at org.apache.calcite.rex.RexUtil$ExprSimplifier.visitCall(RexUtil.java:3016)
	at org.apache.calcite.rex.RexCall.accept(RexCall.java:104)
	at org.apache.calcite.rex.RexShuttle.apply(RexShuttle.java:279)
	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:473)
{noformat}
Int he stack above neither {{RexUtil.simplifyComparison}} nor {{RexUtil.simplifyList}} accept an executor, and thus the executor info present at the {{RexUtil.simplify:1648}} frame is lost and the default {{EXECUTOR}} is used instead. The result is incorrect for Hive.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)