You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "chenhao-db (via GitHub)" <gi...@apache.org> on 2024/04/17 21:00:47 UTC

[PR] [SPARK-47867][FOLLOWUP] Fix variant parsing in JacksonParser. [spark]

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47867][FOLLOWUP] Fix variant parsing in JacksonParser. [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #46107: [SPARK-47867][FOLLOWUP] Fix variant parsing in JacksonParser.
URL: https://github.com/apache/spark/pull/46107


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47867][FOLLOWUP] Fix variant parsing in JacksonParser. [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #46107:
URL: https://github.com/apache/spark/pull/46107#issuecomment-2062813788

   thanks, merging to master!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org