richardstartin commented on a change in pull request #7412:
URL: https://github.com/apache/pinot/pull/7412#discussion_r705017892
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/JsonFunctions.java
##########
@@ -97,9 +102,9 @@ public static String jsonFormat(Object object)
@ScalarFunction
public static Object jsonPath(Object object, String jsonPath) {
if (object instanceof String) {
- return JsonPath.read((String) object, jsonPath);
+ return PARSE_CONTEXT.parse((String) object).read(jsonPath,
NO_PREDICATES);
Review comment:
Yes, it prevents from allocating the array on each call. Alternatively
we could try to add no varargs overloads to the library, which would be cleaner
modulo the point above about guarantees.
--
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]