You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2025/01/10 05:59:31 UTC
Re: [PR] [SPARK-50780][SQL] Use `overrideStdFeatures` instead of `setFeatureMask` [spark]
LuciferYang commented on code in PR #49434:
URL: https://github.com/apache/spark/pull/49434#discussion_r1909867794
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:
##########
@@ -338,8 +339,11 @@ class JacksonParser(
UTF8String.fromBytes(writer.toByteArray)
}
}
- // Reset back to the original configuration:
- parser.setFeatureMask(oldFeature)
+ // Reset back to the original configuration using `~0` as the mask,
+ // which is a bitmask with all bits set, effectively allowing all features
+ // to be reset. This ensures that every feature is restored to its previous
+ // state as defined by `oldFeature`.
+ parser.overrideStdFeatures(oldFeature, ~0)
Review Comment:
can also use a seat mask of `-1` to restore the state, as long as all the bits are set to 1.
--
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