[ 
https://issues.apache.org/jira/browse/CALCITE-7366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-7366.
----------------------------------
    Fix Version/s: 1.42.0
       Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/3e1091b73d74c9238fb09548c897c6a6350676bb]

Thank you for the review [~jensen]

 

> 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
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> 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)

Reply via email to