Interface DataStructureConverter<I,E>

Type Parameters:
I - internal data structure (see RowData)
E - external data structure (see DataType.getConversionClass())
All Superinterfaces:
Serializable
All Known Implementing Classes:
ArrayBooleanArrayConverter, ArrayByteArrayConverter, ArrayDoubleArrayConverter, ArrayFloatArrayConverter, ArrayIntArrayConverter, ArrayListConverter, ArrayLongArrayConverter, ArrayObjectArrayConverter, ArrayShortArrayConverter, DateDateConverter, DateLocalDateConverter, DayTimeIntervalDurationConverter, DecimalBigDecimalConverter, IdentityConverter, LocalZonedTimestampInstantConverter, LocalZonedTimestampIntConverter, LocalZonedTimestampLongConverter, LocalZonedTimestampTimestampConverter, MapMapConverter, RawByteArrayConverter, RawObjectConverter, RowRowConverter, StringByteArrayConverter, StringStringConverter, StructuredObjectConverter, TimeLocalTimeConverter, TimeLongConverter, TimestampLocalDateTimeConverter, TimestampTimestampConverter, TimeTimeConverter, YearMonthIntervalPeriodConverter

@Internal public interface DataStructureConverter<I,E> extends Serializable
Converter between internal and external data structure.

Converters are serializable and can be passed to runtime operators. However, converters are not thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns whether this conversion is a no-op.
    default void
    open(ClassLoader classLoader)
     
    toExternal(I internal)
    Converts to external data structure.
    default E
    toExternalOrNull(I internal)
    Converts to external data structure or null.
    toInternal(E external)
    Converts to internal data structure.
    default I
    toInternalOrNull(E external)
    Converts to internal data structure or null.
  • Method Details

    • open

      default void open(ClassLoader classLoader)
    • toInternal

      I toInternal(E external)
      Converts to internal data structure.

      Note: Parameter must not be null. Output must not be null.

    • toInternalOrNull

      default I toInternalOrNull(E external)
      Converts to internal data structure or null.

      The nullability could be derived from the data type. However, this method reduces null checks.

    • toExternal

      E toExternal(I internal)
      Converts to external data structure.

      Note: Parameter must not be null. Output must not be null.

    • toExternalOrNull

      default E toExternalOrNull(I internal)
      Converts to external data structure or null.

      The nullability could be derived from the data type. However, this method reduces null checks.

    • isIdentityConversion

      default boolean isIdentityConversion()
      Returns whether this conversion is a no-op.

      An identity conversion means that the type is already an internal data structure.