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 2020/07/04 18:07:00 UTC
[jira] [Comment Edited] (SPARK-32167) nullability of
GetArrayStructFields is incorrect
[ https://issues.apache.org/jira/browse/SPARK-32167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17151391#comment-17151391 ]
Dongjoon Hyun edited comment on SPARK-32167 at 7/4/20, 6:06 PM:
----------------------------------------------------------------
With the above example, I verified 2.4.0 and 2.4.5 also have this bug while 2.3.4 doesn't have this. I updated the `Affected Versions`.
was (Author: dongjoon):
I verified 2.4.0 and 2.4.5 also have this bug while 2.3.4 doesn't have this. I updated the `Affected Versions`.
> nullability of GetArrayStructFields is incorrect
> ------------------------------------------------
>
> Key: SPARK-32167
> URL: https://issues.apache.org/jira/browse/SPARK-32167
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 3.0.0
> Reporter: Wenchen Fan
> Assignee: Wenchen Fan
> Priority: Blocker
> Labels: correctness
>
> The following should be `Array([WrappedArray(1, null)])` instead of `Array([WrappedArray(1, 0)])`
> {code:java}
> import scala.collection.JavaConverters._
> import org.apache.spark.sql.Row
> import org.apache.spark.sql.types.{ArrayType, StructType}val innerStruct = new StructType().add("i", "int", nullable = true)
> val schema = new StructType().add("arr", ArrayType(innerStruct, containsNull = false))
> val df = spark.createDataFrame(List(Row(Seq(Row(1), Row(null)))).asJava, schema)
> df.select($"arr".getField("i")).collect{code}
>
--
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