Class DataTypeJsonSerDe

Object
io.delta.kernel.internal.types.DataTypeJsonSerDe

public class DataTypeJsonSerDe extends Object
Serialize and deserialize Delta data types DataType to JSON and from JSON class based on the serialization rules outlined in the Delta Protocol.
  • Method Details

    • serializeStructType

      public static String serializeStructType(StructType structType)
      Serializes a StructType to a JSON string
      Parameters:
      structType -
      Returns:
    • serializeDataType

      public static String serializeDataType(DataType dataType)
      Serializes a DataType to a JSON string according to the Delta Protocol. TODO: Only reason why this API added was due to Flink-Kernel dependency. Currently Flink-Kernel uses the Kernel DataType.toJson and Standalone DataType.fromJson to convert between types.
      Parameters:
      dataType -
      Returns:
      JSON string representing the data type
    • deserializeStructType

      public static StructType deserializeStructType(String structTypeJson)
      Deserializes a JSON string representing a Delta data type to a DataType.
      Parameters:
      structTypeJson - JSON string representing a StructType data type