Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
2.4.0
-
None
-
None
-
Spark 2.4
Scala 2.11
Description
This is code for reproducing.
val testTable = "testseq" val df = Seq(Some(Seq(1L,2L,3L)), None).toDF("seq") sqlContext.sql(s"DROP TABLE IF EXISTS $testTable") df.write.format("parquet").saveAsTable(testTable) val res = sqlContext.table(testTable) assert(df.schema === res.schema)
My code is trying to save dataframe with array type and read from that table. After checking schema, I found that schema has change.
This is the assertion message.
Expected :StructType(StructField(seq,ArrayType(LongType,true),true)) Actual :StructType(StructField(seq,ArrayType(LongType,false),true))
containsNull in ArrayType changes from false to true after reading from the table.
Attachments
Issue Links
- duplicates
-
SPARK-16472 Inconsistent nullability in schema after being read
- Resolved
- links to