You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2019/07/16 16:42:14 UTC

[jira] [Updated] (SPARK-24148) Adding Ability to Specify SQL Type of Empty Arrays

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

Dongjoon Hyun updated SPARK-24148:
----------------------------------
    Affects Version/s:     (was: 2.4.0)
                       3.0.0

> Adding Ability to Specify SQL Type of Empty Arrays
> --------------------------------------------------
>
>                 Key: SPARK-24148
>                 URL: https://issues.apache.org/jira/browse/SPARK-24148
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Marek Novotny
>            Priority: Major
>
> The function array(...) doesn't let user specify the element type and uses string as default.
> This is a shortcoming in the API as the developer either needs a scala case class and let catalyst infer the schema or by using the Java UDF API.
> This Jira suggests ehnancement of the array function, which will produce an empty array of a given element type.
> A perfect example of the use case is {{when(cond, trueExp).otherwise(falseExp)}}, which expects {{trueExp}} and {{falseExp}} of being the same type. In scenario where we want to produce an empty array, in one of these cases, there's no other way than creating an UDF.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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