You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mihai Budiu (Jira)" <ji...@apache.org> on 2024/02/27 01:27:00 UTC

[jira] [Updated] (CALCITE-6283) Function array_append function with a NULL array argument crashes with NullPointerException

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

Mihai Budiu updated CALCITE-6283:
---------------------------------
    Summary: Function array_append function with a NULL array argument crashes with NullPointerException  (was: array_append function with a NULL array argument crashes with a NullPointerException)

> Function array_append function with a NULL array argument crashes with NullPointerException
> -------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6283
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6283
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> The following test added to SqlOperatorTest:
> {code:java}
> f.checkNull("array_append(null, 2)");
> {code}
> causes Calcite to crash with the following stack trace:
> {code}
> java.lang.NullPointerException: componentType is null for NULL
> 	at java.base/java.util.Objects.requireNonNull(Objects.java:347)
> 	at org.apache.calcite.sql.type.NonNullableAccessors.getComponentTypeOrThrow(NonNullableAccessors.java:52)
> 	at org.apache.calcite.sql.type.ArrayElementOperandTypeChecker.checkOperandTypes(ArrayElementOperandTypeChecker.java:49)
> 	at org.apache.calcite.sql.SqlOperator.checkOperandTypes(SqlOperator.java:761)
> 	at org.apache.calcite.sql.SqlOperator.validateOperands(SqlOperator.java:498)
> 	at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:347)
> 	at org.apache.calcite.sql.SqlFunction.deriveType(SqlFunction.java:231)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)