Package com.databricks.jdbc.api.impl
Class ComplexDataTypeParser
- java.lang.Object
-
- com.databricks.jdbc.api.impl.ComplexDataTypeParser
-
public class ComplexDataTypeParser extends Object
Utility class for parsing complex data type objects (map, array, struct).
-
-
Constructor Summary
Constructors Constructor Description ComplexDataTypeParser()Constructor class for ComplexDataTypeParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeparse(String json)Parses a JSON string into a JsonNode.List<Object>parseToArray(com.fasterxml.jackson.databind.JsonNode node, String elementType)Parses a JsonNode into an Array representation using the provided element type.Map<String,Object>parseToMap(String json, String metadata)Parses a JSON string into a Map representation based on the provided metadata.Map<String,Object>parseToStruct(com.fasterxml.jackson.databind.JsonNode node, Map<String,String> typeMap)Parses a JsonNode into a Struct representation using the provided type map.
-
-
-
Method Detail
-
parse
public com.fasterxml.jackson.databind.JsonNode parse(String json)
Parses a JSON string into a JsonNode.- Parameters:
json- the JSON string to parse- Returns:
- the parsed JsonNode
-
parseToStruct
public Map<String,Object> parseToStruct(com.fasterxml.jackson.databind.JsonNode node, Map<String,String> typeMap)
Parses a JsonNode into a Struct representation using the provided type map.- Parameters:
node- the JsonNode to parsetypeMap- the type map defining the structure of the Struct- Returns:
- a Map representing the Struct
-
parseToArray
public List<Object> parseToArray(com.fasterxml.jackson.databind.JsonNode node, String elementType)
Parses a JsonNode into an Array representation using the provided element type.- Parameters:
node- the JsonNode to parseelementType- the type of elements in the array- Returns:
- a List representing the Array
-
parseToMap
public Map<String,Object> parseToMap(String json, String metadata)
Parses a JSON string into a Map representation based on the provided metadata.- Parameters:
json- the JSON string to parsemetadata- the metadata defining the structure of the Map- Returns:
- a Map representing the parsed JSON
-
-