You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/02/02 19:25:10 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #8111: fix error handling in json functions with default values

Jackie-Jiang commented on a change in pull request #8111:
URL: https://github.com/apache/pinot/pull/8111#discussion_r797942207



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/function/scalar/JsonFunctions.java
##########
@@ -89,7 +89,7 @@ public static Object jsonPath(Object object, String jsonPath) {
     if (object instanceof String) {
       return PARSE_CONTEXT.parse((String) object).read(jsonPath, NO_PREDICATES);
     }
-    return PARSE_CONTEXT.parse(object).read(jsonPath, NO_PREDICATES);
+    return object == null ? null : PARSE_CONTEXT.parse(object).read(jsonPath, NO_PREDICATES);

Review comment:
       Input `object` should not be `null`. IMO We can let it throw NPE




-- 
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: commits-unsubscribe@pinot.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org