[
https://issues.apache.org/jira/browse/FLINK-31166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698315#comment-17698315
]
jackylau commented on FLINK-31166:
----------------------------------
have fixed this pr info [~Sergey Nuyanzin] , thanks for your detail review very
much and i have learned a lot
> array_contains element type error
> ---------------------------------
>
> Key: FLINK-31166
> URL: https://issues.apache.org/jira/browse/FLINK-31166
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.18.0
> Reporter: jackylau
> Assignee: jackylau
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.18.0
>
> Attachments: image-2023-02-21-18-37-45-202.png,
> image-2023-02-21-18-41-19-385.png, image-2023-02-22-09-56-59-257.png
>
>
> {{ARRAY_CONTAINS}} works ok for the case when both haystack elements and
> needle are not nullable e.g.
> {code:sql}
> SELECT array_contains(ARRAY[0, 1], 0);{code}
> it works ok when both haystack elements and needle are nullable e.g.
> {code:sql}
> SELECT array_contains(ARRAY[0, 1, NULL], CAST(NULL AS INT));{code}
> it works ok when haystack elements are nullable and needle is not nullable
> e.g.
> {code:sql}
> SELECT array_contains(ARRAY[0, 1, NULL], 1);{code}
> and it does NOT work when haystack elements are not nullable and needle is
> nullable e.g.
> {code:sql}
> SELECT array_contains(ARRAY[0, 1], CAST(NULL AS INT));{code}
>
> !image-2023-02-22-09-56-59-257.png!
>
> !image-2023-02-21-18-41-19-385.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)