Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.16.0
-
None
Description
Query like the following
SELECT substring(namespace, CAST(deleted AS INT), 4) FROM druid_table;
will fail with
java.lang.AssertionError: not a literal: $13 at org.apache.calcite.rex.RexLiteral.findValue(RexLiteral.java:963) at org.apache.calcite.rex.RexLiteral.findValue(RexLiteral.java:955) at org.apache.calcite.rex.RexLiteral.intValue(RexLiteral.java:938) at org.apache.calcite.adapter.druid.SubstringOperatorConversion.toDruidExpression(SubstringOperatorConversion.java:46) at org.apache.calcite.adapter.druid.DruidExpressions.toDruidExpression(DruidExpressions.java:120) at org.apache.calcite.adapter.druid.DruidQuery.computeProjectAsScan(DruidQuery.java:746) at org.apache.calcite.adapter.druid.DruidRules$DruidProjectRule.onMatch(DruidRules.java:308) at org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:317)
Druid Substring converter is assuming that index is always a constant literal, which is wrong.
Attachments
Issue Links
- relates to
-
HIVE-18996 SubString Druid convertor assuming that index is always constant literal value
- Open
- links to