Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.35.0
Description
The following test added to RelOptRules test causes an AssertionError:
@Test void testExtractDayFromTime() { final String sql = "select EXTRACT(DAY FROM TIME'10:00:00')"; sql(sql).withRule(CoreRules.PROJECT_REDUCE_EXPRESSIONS) .check(); }
The bottom of the stack trace is:
java.lang.AssertionError: unexpected TIME at org.apache.calcite.adapter.enumerable.RexImpTable$ExtractImplementor.implementSafe(RexImpTable.java:3056) at org.apache.calcite.adapter.enumerable.RexImpTable$AbstractRexCallImplementor.genValueStatement(RexImpTable.java:3796) at org.apache.calcite.adapter.enumerable.RexImpTable$AbstractRexCallImplementor.implement(RexImpTable.java:3758) at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitCall(RexToLixTranslator.java:1184) at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitCall(RexToLixTranslator.java:101) at org.apache.calcite.rex.RexCall.accept(RexCall.java:189)
This expression is indeed illegal. Perhaps validation should produce an error?
Attachments
Issue Links
- duplicates
-
CALCITE-6327 getValidatedNodeTypeIfKnown should never throw
- Resolved
- links to