You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2023/03/09 10:23:00 UTC

[jira] [Commented] (FLINK-31166) array_contains element type error

    [ https://issues.apache.org/jira/browse/FLINK-31166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698305#comment-17698305 ] 

Sergey Nuyanzin commented on FLINK-31166:
-----------------------------------------

[~jackylau] can you please update jira description with some example e.g. from the PR.
Having screenshots in description does not help much since it is impossible to copy&paste and run on Flink.

if i understand correctly from the PR:
{{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 null 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}

I'm asking since for me 
in fact it was impossible to get to this from jira description reading and I still want to double check if I understand it correctly

> 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
>
>
> !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)