You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2019/11/05 05:45:00 UTC
[jira] [Resolved] (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 ]
Hyukjin Kwon resolved SPARK-24148.
----------------------------------
Resolution: Won't Fix
> 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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org