HyukjinKwon commented on a change in pull request #33436:
URL: https://github.com/apache/spark/pull/33436#discussion_r673592374



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala
##########
@@ -521,7 +521,7 @@ class DataFrameReader private[sql](sparkSession: 
SparkSession) extends Logging {
         None
       }
 
-    val schema = userSpecifiedSchema.getOrElse {
+    val schema = userSpecifiedSchema.map(_.asNullable).getOrElse {

Review comment:
       Actually would you mind updating migration guide 
(https://github.com/apache/spark/blob/master/docs/sql-migration-guide.md)? You 
can describe, for example, non-nullable schema was not supported properly in 
previous Spark version so the output schema of 
`DataFrameReader.json(jsonDataset: Dataset[String])` and 
`DataFrameReader.csv(csvDataset: Dataset[String])` became nullable which also 
matches with `DataFrameReader.json(path: String)` and 
`DataFrameReader.csv(path: String)`.
   




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to