uros-b commented on code in PR #56691:
URL: https://github.com/apache/spark/pull/56691#discussion_r3461428265
##########
common/variant/src/main/java/org/apache/spark/types/variant/VariantBuilder.java:
##########
@@ -42,6 +42,11 @@
* Build variant value and metadata by parsing JSON values.
*/
public class VariantBuilder {
+ // Jackson's JsonFactory is thread-safe and intended to be reused. parseJson
is invoked once per
+ // input JSON value (e.g. per row in parse_json), so sharing a single
factory avoids allocating
+ // one (and its symbol tables) on every call.
+ private static final JsonFactory JSON_FACTORY = new JsonFactory();
Review Comment:
Nit: two separate JSON_FACTORY statics encode the same default config in
Variant.java and VariantBuilder.java. A single shared constant (e.g. on
VariantUtil) would avoid future config drift.
--
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]