Package org.apache.druid.segment.nested
Class NestedPathFinder
- java.lang.Object
-
- org.apache.druid.segment.nested.NestedPathFinder
-
public class NestedPathFinder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringJQ_PATH_ROOTstatic StringJSON_PATH_ROOT
-
Constructor Summary
Constructors Constructor Description NestedPathFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Objectfind(Object data, List<NestedPathPart> path)Dig through a thing to find stuffstatic Object[]findKeys(Object data, List<NestedPathPart> path)find the list of 'keys' at some path.static List<NestedPathPart>parseJqPath(String path)split a jq path into a series of extractors to find things in stuffstatic List<NestedPathPart>parseJsonPath(String path)split a JSONPath path into a series of extractors to find things in stuffstatic StringtoNormalizedJqPath(List<NestedPathPart> paths)Given a list of part finders, convert it to a "normalized" 'jq' path format that is consistent with howStructuredDataProcessorconstructs field path namesstatic StringtoNormalizedJsonPath(List<NestedPathPart> paths)
-
-
-
Field Detail
-
JSON_PATH_ROOT
public static final String JSON_PATH_ROOT
- See Also:
- Constant Field Values
-
JQ_PATH_ROOT
public static final String JQ_PATH_ROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
find
@Nullable public static Object find(@Nullable Object data, List<NestedPathPart> path)
Dig through a thing to find stuff
-
findKeys
@Nullable public static Object[] findKeys(@Nullable Object data, List<NestedPathPart> path)
find the list of 'keys' at some path. - if the thing at a path is an object (map), return the fields - if the thing at a path is an array (list or array), return the 0 based element numbers - if the thing is a simple value, return null
-
toNormalizedJsonPath
public static String toNormalizedJsonPath(List<NestedPathPart> paths)
-
parseJsonPath
public static List<NestedPathPart> parseJsonPath(@Nullable String path)
split a JSONPath path into a series of extractors to find things in stuff
-
toNormalizedJqPath
public static String toNormalizedJqPath(List<NestedPathPart> paths)
Given a list of part finders, convert it to a "normalized" 'jq' path format that is consistent with howStructuredDataProcessorconstructs field path names
-
parseJqPath
public static List<NestedPathPart> parseJqPath(@Nullable String path)
split a jq path into a series of extractors to find things in stuff
-
-