Mihai Budiu created CALCITE-6283:
------------------------------------
Summary: array_append function with a NULL array argument crashes
with a 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
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)