diff --git a/core/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java b/core/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java index 6df37ae1d11..18f73fa9def 100644 --- a/core/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java +++ b/core/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java @@ -86,7 +86,14 @@ public class JSONFlattenerMaker implements ObjectFlatteners.FlattenerMaker makeJsonPathExtractor(final String expr) { final JsonPath jsonPath = JsonPath.compile(expr); - return node -> valueConversionFunction(jsonPath.read(node, JSONPATH_CONFIGURATION)); + return node -> { + Object val = jsonPath.read(node, JSONPATH_CONFIGURATION); + if (val instanceof JsonNode) { + return valueConversionFunction((JsonNode) val); + } else { + return val; + } + }; } @Override @@ -115,17 +122,7 @@ public class JSONFlattenerMaker implements ObjectFlatteners.FlattenerMaker