You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/01/05 20:15:00 UTC
[jira] [Commented] (CALCITE-5407) MongoDB: Invalid ARRAY conversion
[ https://issues.apache.org/jira/browse/CALCITE-5407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655124#comment-17655124 ]
Julian Hyde commented on CALCITE-5407:
--------------------------------------
[~tnieradzik], Looks good. The only thing I'd change is the commit message. Our practice is to use the bug summary as the commit message. (Therefore commit messages vary rarely contain the word 'fix'.) It seems to me that 'MongoDB adapter throws NullPointerException when converting an array' is a good description of the bug - and suitable for the release notes. What do you think?
If you can do this today, we can get into release 1.33.
> MongoDB: Invalid ARRAY conversion
> ---------------------------------
>
> Key: CALCITE-5407
> URL: https://issues.apache.org/jira/browse/CALCITE-5407
> Project: Calcite
> Issue Type: Bug
> Components: mongodb-adapter
> Affects Versions: 1.32.0
> Reporter: Tim Nieradzik
> Assignee: Tim Nieradzik
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.33.0
>
>
> When using the MongoDB adapter, the following conversion does not work as expected:
> {code}
> cast(_MAP['arr'] as VARCHAR ARRAY)
> {code}
> This throws the following exception:
> {noformat}
> Caused by: java.lang.NullPointerException: componentType of ITEM($0, 'arr')
> at java.base/java.util.Objects.requireNonNull(Objects.java:347)
> at org.apache.calcite.sql2rel.StandardConvertletTable.convertCast(StandardConvertletTable.java:603)
> at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:59)
> at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:5547)
> at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4711)
> at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:161)
> at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:5360)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:4524)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:756)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:677)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3741)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:597)
> 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:651)
> at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:517)
> at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:487)
> at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:236)
> at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
> at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:677)
> at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
> ... 67 more
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)