[ https://issues.apache.org/jira/browse/CALCITE-5130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-5130: ------------------------------------ Labels: pull-request-available (was: ) > AssertionError: "Conversion to relational algebra failed to preserve > datatypes" when union VARCHAR literal and CAST(null AS INTEGER) > ------------------------------------------------------------------------------------------------------------------------------------- > > Key: CALCITE-5130 > URL: https://issues.apache.org/jira/browse/CALCITE-5130 > Project: Calcite > Issue Type: Bug > Affects Versions: 1.31.0 > Reporter: Yingyu Wang > Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > 0: jdbc:calcite:model=src/test/resources/mode> select CAST(null AS INTEGER) > union select '10'; > java.lang.AssertionError: Conversion to relational algebra failed to preserve > datatypes: > validated type: > RecordType(VARCHAR NOT NULL EXPR$0) NOT NULL > converted type: > RecordType(VARCHAR EXPR$0) NOT NULL > rel: > LogicalUnion(all=[false]) > LogicalValues(tuples=[[\{ null }]]) > LogicalValues(tuples=[[\{ '10' }]]) > > at > org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:487) > at > org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:602) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:257) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:648) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:514) > at > org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:484) > at > org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:234) > at > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623) > at > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:674) > at > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156) > at > org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:217) > at sqlline.Commands.executeSingleQuery(Commands.java:1130) > at sqlline.Commands.execute(Commands.java:1079) > at sqlline.Commands.sql(Commands.java:1033) > at sqlline.SqlLine.dispatch(SqlLine.java:822) > at sqlline.SqlLine.begin(SqlLine.java:596) > at sqlline.SqlLine.start(SqlLine.java:269) > at sqlline.SqlLine.main(SqlLine.java:208) -- This message was sent by Atlassian Jira (v8.20.7#820007)