gengliangwang commented on a change in pull request #33308:
URL: https://github.com/apache/spark/pull/33308#discussion_r674113916



##########
File path: 
external/avro/src/test/scala/org/apache/spark/sql/avro/AvroSuite.scala
##########
@@ -1403,7 +1403,8 @@ abstract class AvroSuite
           df.write.option("avroSchema", 
avroSchema).format("avro").save(s"$tempDir/save2")
         }
         assertExceptionMsg[IncompatibleSchemaException](e,
-          "Cannot find field 'FOO' (at position 0) in Avro schema at top-level 
record")
+          "Cannot find SQL field(s) in Avro top-level record: " +

Review comment:
       The original error message is clear about the Avro schema doesn't have 
the field, while the new one makes me confused about which schema has missed 
field, Avro or Catalyst.
   
   Also, showing one error at a time is OK.
   
   @xkrogen Shall we keep the error message as it is? This PR can be just 
moving the schema validation to the `AvroSchemaHelper`. I am sorry but it's my 
personal taste as a non-native speaker. 




-- 
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