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/07 03:11:00 UTC

[jira] [Resolved] (SPARK-32167) nullability of GetArrayStructFields is incorrect

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

Dongjoon Hyun resolved SPARK-32167.
-----------------------------------
    Fix Version/s: 3.1.0
                   3.0.1
       Resolution: Fixed

This is resolved via https://github.com/apache/spark/pull/28992

> 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: 1.6.3, 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.6, 3.0.0
>            Reporter: Wenchen Fan
>            Assignee: Wenchen Fan
>            Priority: Blocker
>              Labels: correctness
>             Fix For: 3.0.1, 3.1.0
>
>
> 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