[
https://issues.apache.org/jira/browse/CALCITE-5961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ran Tao updated CALCITE-5961:
-----------------------------
Summary: Type inference of ARRAY_COMPACT is incorrect (was: Inference type
of ARRAY_COMPACT is incorrect)
> Type inference of ARRAY_COMPACT is incorrect
> --------------------------------------------
>
> Key: CALCITE-5961
> URL: https://issues.apache.org/jira/browse/CALCITE-5961
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.35.0
> Reporter: Ran Tao
> Assignee: Ran Tao
> Priority: Major
>
> The return type of
> {code:java}
> array_compact(array[null, 1, null, 2]){code}
> is INTEGER ARRAY NOT NULL, but from semantics the correct type should be
> INTEGER NOT NULL ARRAY NOT NULL.
> because the returned result can not has NULL value.
> currently, array_compact use ARG0_NULLABLE which is not enough.
> {code:java}
> public static final SqlFunction ARRAY_COMPACT =
> SqlBasicFunction.create(SqlKind.ARRAY_COMPACT,
> ReturnTypes.ARG0_NULLABLE,
> OperandTypes.ARRAY);{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)