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/27 07:06:00 UTC

[jira] [Resolved] (SPARK-25522) Improve type promotion for input arguments of elementAt function

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

Wenchen Fan resolved SPARK-25522.
---------------------------------
       Resolution: Fixed
    Fix Version/s:     (was: 2.4.0)
                   2.5.0

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

>  Improve type promotion for input arguments of elementAt function
> -----------------------------------------------------------------
>
>                 Key: SPARK-25522
>                 URL: https://issues.apache.org/jira/browse/SPARK-25522
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Dilip Biswal
>            Assignee: Dilip Biswal
>            Priority: Major
>             Fix For: 2.5.0
>
>
> In ElementAt, when first argument is MapType, we should coerce the key type and the second argument based on findTightestCommonType. This is not happening currently.
> Also, when the first argument is ArrayType, the second argument should be an integer type or a smaller integral type that can be safely casted to an integer type. Currently we may do an unsafe cast.
> {code:java}
> spark-sql> select element_at(array(1,2), 1.24);
> 1{code}
> {code:java}
> spark-sql> select element_at(map(1,"one", 2, "two"), 2.2);
> two{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