Mihai Budiu created CALCITE-7366:
------------------------------------
Summary: RexLiteral.valueMatchesType throws for a MAP type
Key: CALCITE-7366
URL: https://issues.apache.org/jira/browse/CALCITE-7366
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.41.0
Reporter: Mihai Budiu
Assignee: Mihai Budiu
This can be triggered by the compilation of a program such as
{code:java}
SELECT CAST('a' AS MAP<INT, INT>); {code}
Leading to:
{code:java}
> java.lang.AssertionError: Was not expecting value 'MAP' for enumeration
> 'org.apache.calcite.sql.type.SqlTypeName' in this context
> at org.apache.calcite.util.Util.unexpected(Util.java:1937)
> at org.apache.calcite.rex.RexLiteral.valueMatchesType(RexLiteral.java:406)
> at
> org.apache.calcite.rex.RexBuilder.canRemoveCastFromLiteral(RexBuilder.java:904)
> at org.apache.calcite.rex.RexBuilder.makeCast(RexBuilder.java:808)
> at
> org.apache.calcite.sql2rel.StandardConvertletTable.convertCast(StandardConvertletTable.java:825)
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)