LiShuMing commented on a change in pull request #25192: [SPARK-28436][SQL] 
Throw better exception when datasource's schema i…
URL: https://github.com/apache/spark/pull/25192#discussion_r308003118
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
 ##########
 @@ -339,7 +339,8 @@ case class DataSource(
         val baseRelation =
           dataSource.createRelation(sparkSession.sqlContext, 
caseInsensitiveOptions)
         if (baseRelation.schema != schema) {
-          throw new AnalysisException(s"$className does not allow 
user-specified schemas.")
+          throw new AnalysisException(s"$className does not allow 
user-specified schemas, " +
+              s"source schema: ${baseRelation.schema}, user-specific schema: 
${schema}")
 
 Review comment:
   I think `schema.catalogString` is still not better than `schema.treeString` 
because `schema.catalogString` cannot express `nullable` values. What do you 
think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to