chenhao-db opened a new pull request, #46107:
URL: https://github.com/apache/spark/pull/46107

   ### What changes were proposed in this pull request?
   
   This PR fixes an issue introduced in 
https://github.com/apache/spark/pull/46071. When parsing a JSON object as a map 
or struct, the `JacksonParser` only peeks the `FIELD_NAME` token without 
consuming it. `VariantBuilder.parseJson` will then fail because the current 
token is `FIELD_NAME` rather than the starting token of the value. Previous 
tests with struct schemas didn't fail because the parsing error was caught and 
the parser would then consume the field name, and the field value would be read 
in the next iteration. However, a map schema with variant value would fail.
   
   ### Why are the changes needed?
   
   It is a bug fix and allows Spark to read a map schema with variant value 
(for example, `map<string, variant>`) correctly.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   A new unit test. It would fail without the changes.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


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