You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2018/09/20 12:37:00 UTC

[jira] [Resolved] (SPARK-25417) ArrayContains function may return incorrect result when right expression is implicitly down casted

     [ https://issues.apache.org/jira/browse/SPARK-25417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan resolved SPARK-25417.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.0

Issue resolved by pull request 22408
[https://github.com/apache/spark/pull/22408]

> ArrayContains function may return incorrect result when right expression is implicitly down casted
> --------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-25417
>                 URL: https://issues.apache.org/jira/browse/SPARK-25417
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Dilip Biswal
>            Assignee: Dilip Biswal
>            Priority: Major
>             Fix For: 2.4.0
>
>
> In ArrayContains, we currently cast the right hand side expression to match the element type of the left hand side Array. This may result in down casting and may return wrong result or questionable result.
> Example :
> {code:java}
> spark-sql> select array_position(array(1), 1.34);
> true
> {code}
>  
> {code:java}
> spark-sql> select array_position(array(1), 'foo');
> null
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org