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 2022/01/06 07:52:00 UTC
[jira] [Resolved] (SPARK-37822) SQL function `split` should return an array of non-nullable elements
[ https://issues.apache.org/jira/browse/SPARK-37822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-37822.
---------------------------------
Fix Version/s: 3.3.0
Resolution: Fixed
Issue resolved by pull request 35111
[https://github.com/apache/spark/pull/35111]
> SQL function `split` should return an array of non-nullable elements
> --------------------------------------------------------------------
>
> Key: SPARK-37822
> URL: https://issues.apache.org/jira/browse/SPARK-37822
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Shardul Mahadik
> Assignee: Shardul Mahadik
> Priority: Major
> Fix For: 3.3.0
>
>
> Currently, {{split}} [returns the data type|https://github.com/apache/spark/blob/08dd010860cc176a33073928f4c0780d0ee98a08/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala#L532] {{ArrayType(StringType)}} which means the resultant array can contain nullable elements. However I do not see any case where the array can contain nulls.
> In the case where either the provided string or delimiter is NULL, the output will be a NULL array. In case of empty string or no chars between delemiters, the output array will contain empty strings but never NULLs. So I propose we change the return type of {{split}} to mark elements as non-null.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org