Class ComplexDataTypeParser
java.lang.Object
com.databricks.jdbc.api.impl.ComplexDataTypeParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatComplexTypeString(String jsonString, String complexType, String typeMetadata) Formats a complex type JSON string into a consistent string format.formatMapString(String jsonString, String mapMetadata) Formats a map JSON string into the standard {key:value} format.parseJsonStringToDbArray(String json, String arrayMetadata) parseJsonStringToDbMap(String json, String mapMetadata) parseJsonStringToDbStruct(String json, String structMetadata) parseToArray(com.fasterxml.jackson.databind.JsonNode node, String arrayMetadata) parseToMap(com.fasterxml.jackson.databind.JsonNode node, String mapMetadata) parseToStruct(com.fasterxml.jackson.databind.JsonNode node, String structMetadata)
-
Constructor Details
-
ComplexDataTypeParser
public ComplexDataTypeParser()
-
-
Method Details
-
parseJsonStringToDbArray
public DatabricksArray parseJsonStringToDbArray(String json, String arrayMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
parseJsonStringToDbMap
public DatabricksMap<String,Object> parseJsonStringToDbMap(String json, String mapMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
parseJsonStringToDbStruct
public DatabricksStruct parseJsonStringToDbStruct(String json, String structMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
parseToArray
public DatabricksArray parseToArray(com.fasterxml.jackson.databind.JsonNode node, String arrayMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
parseToMap
public DatabricksMap<String,Object> parseToMap(com.fasterxml.jackson.databind.JsonNode node, String mapMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
parseToStruct
public DatabricksStruct parseToStruct(com.fasterxml.jackson.databind.JsonNode node, String structMetadata) throws DatabricksParsingException - Throws:
DatabricksParsingException
-
formatComplexTypeString
Formats a complex type JSON string into a consistent string format. This is primarily used when complex datatype support is disabled.- Parameters:
jsonString- The JSON string representation of the complex typecomplexType- The type of complex data (MAP, ARRAY, STRUCT)typeMetadata- The metadata for the type (e.g., "MAPinvalid input: '<'INT,INT>")- Returns:
- A consistently formatted string representation
-
formatMapString
Formats a map JSON string into the standard {key:value} format.- Parameters:
jsonString- The JSON string representation of the mapmapMetadata- The metadata for the map type (e.g., "MAPinvalid input: '<'INT,INT>")- Returns:
- A map string in the format {key:value,key:value}
-