Class MetadataParser


  • public class MetadataParser
    extends Object
    Utility class for parsing metadata descriptions into structured type mappings.
    • Constructor Detail

      • MetadataParser

        public MetadataParser()
    • Method Detail

      • parseStructMetadata

        public static Map<String,​String> parseStructMetadata​(String metadata)
        Parses STRUCT metadata to extract field types.
        Parameters:
        metadata - the metadata string representing a STRUCT type
        Returns:
        a map where each key is a field name, and the value is the field's data type
      • parseArrayMetadata

        public static String parseArrayMetadata​(String metadata)
        Parses ARRAY metadata to retrieve the element type.
        Parameters:
        metadata - the metadata string representing an ARRAY type
        Returns:
        the element type contained within the array
      • parseMapMetadata

        public static String parseMapMetadata​(String metadata)
        Parses MAP metadata to retrieve key and value types.
        Parameters:
        metadata - the metadata string representing a MAP type
        Returns:
        a string formatted as "keyType, valueType"
        Throws:
        DatabricksDriverException - if the MAP metadata format is invalid