Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
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:
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)
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.
Attachments
Issue Links
- blocks
-
HIVE-15708 Upgrade calcite version to 1.12
- Closed
- is related to
-
CALCITE-1653 Pass an expression executor to RexUtil.simplify for constant reduction
- Closed
- relates to
-
CALCITE-2974 Timestamp conversion performance can be improved
- Reopened