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

[jira] [Updated] (SPARK-25416) ArrayPosition function may return incorrect result when right expression is implicitly downcasted.

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

Dilip Biswal updated SPARK-25416:
---------------------------------
    Summary: ArrayPosition function may return incorrect result when right expression is implicitly downcasted.  (was: ArrayPosition may return incorrect result when right expression is downcasted.)

> ArrayPosition function may return incorrect result when right expression is implicitly downcasted.
> --------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-25416
>                 URL: https://issues.apache.org/jira/browse/SPARK-25416
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Dilip Biswal
>            Priority: Major
>
> In ArrayPosition, 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 :
> spark-sql> select array_position(array(1), 1.34);
> 1
> spark-sql> select array_position(array(1), 'foo');
> null
> We should safely coerce both left and right hand side expressions.



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