[ 
https://issues.apache.org/jira/browse/CALCITE-5407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655124#comment-17655124
 ] 

Julian Hyde edited comment on CALCITE-5407 at 1/5/23 8:15 PM:
--------------------------------------------------------------

[~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?

Can you rebase your commit onto latest main, and change the commit message? If 
you can do this today, we can get into release 1.33.


was (Author: julianhyde):
[~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)

Reply via email to