[
https://issues.apache.org/jira/browse/CALCITE-6283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821123#comment-17821123
]
Caican Cai edited comment on CALCITE-6283 at 2/27/24 9:43 AM:
--------------------------------------------------------------
I looked at the spark3.4 source code, and it seems that passing in null is not
supported. I don’t know if this is a spark bug
was (Author: JIRAUSER302115):
I looked at the spark3.4 source code, and it seems that passing in null is not
supported.
> Function array_append 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
> Assignee: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
>
> 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)