Github user bdrillard commented on a diff in the pull request: https://github.com/apache/spark/pull/20010#discussion_r157792706 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala --- @@ -389,6 +389,25 @@ class TypeCoercionSuite extends AnalysisTest { widenTest(StringType, MapType(IntegerType, StringType, true), None) widenTest(ArrayType(IntegerType), StructType(Seq()), None) + widenTest( + ArrayType(StringType, containsNull=true), + ArrayType(StringType, containsNull=false), + Some(ArrayType(StringType, containsNull=true))) + widenTest( + MapType(StringType, StringType, valueContainsNull=true), + MapType(StringType, StringType, valueContainsNull=false), + Some(MapType(StringType, StringType, valueContainsNull=true))) + + widenTest( + StructType(StructField("a", ArrayType(StringType, containsNull=true)) :: Nil), + StructType(StructField("a", ArrayType(StringType, containsNull=false)) :: Nil), + Some(StructType(StructField("a", ArrayType(StringType, containsNull=true)) :: Nil))) + widenTest( + StructType(StructField("a", MapType(StringType, StringType, valueContainsNull=true)) :: Nil), + StructType(StructField("a", MapType(StringType, StringType, valueContainsNull=false)) :: Nil), + Some(StructType( + StructField("a", MapType(StringType, StringType, valueContainsNull=true)) :: Nil))) --- End diff -- Here's a test for nested structures where an explicit match case against ArrayType/MapType is necessary due to the difference in nullability between the two structures.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org