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



##########
File path: 
external/avro/src/test/scala/org/apache/spark/sql/avro/AvroSerdeSuite.scala
##########
@@ -86,18 +86,18 @@ class AvroSerdeSuite extends SparkFunSuite {
     // deserialize should have no issues when 'bar' is nullable but fail when 
it is nonnull
     Deserializer.create(CATALYST_STRUCT, avro, BY_NAME)
     assertFailedConversionMessage(avro, Deserializer, BY_NAME,
-      "Cannot find non-nullable field 'foo.bar' (at position 0) in Avro 
schema.",
+      "Cannot find field 'foo.bar' (at position 0) in Avro schema at field 
'foo'",

Review comment:
       Yes I think you're right. I think the issue is that I was trying too 
hard to unify the code paths / exception messages for the by-name and 
by-position cases. I've updated this and I think the messages should be more 
readable now.
   
   In the case of positional matching, I still report the field names of both 
the SQL and Avro fields, since they may be different. I can add logic to omit 
the second instance of the name if they're matching, but I don't think it's 
necessary. Lmk your thoughts.




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