panbingkun opened a new pull request, #40280: URL: https://github.com/apache/spark/pull/40280
### What changes were proposed in this pull request? The pr aims to fix bug for createDataFrame from complex type schema. ### Why are the changes needed? When I code UT for `DataFrameNaFunctions`, I found: val schema = new StructType() .add("c1", new StructType() .add("c1-1", StringType) .add("c1-2", StringType)) val data = Seq(Row(Row(null, "a2")), Row(Row("b1", "b2")), Row(null)) val df = spark.createDataFrame(data.asJava, schema) df.show() Unable to work. The error message is as follows: <img width="657" alt="image" src="https://user-images.githubusercontent.com/15246973/222938339-77dec8c6-549b-41de-869b-8a191a0f745e.png"> ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Add new UT Pass GA. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org