Class DataViewUtils

java.lang.Object
org.apache.flink.table.planner.typeutils.DataViewUtils

@Internal public final class DataViewUtils extends Object
Utilities to deal with DataViews.

A DataView is either represented as a regular StructuredType or as a RawType that serializes to null when backed by a state backend. In the latter case, a DataViewSpec contains all information necessary to store and retrieve data from state.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Specification for a special MapView for deduplication.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.flink.table.types.DataType
    adjustDataViews(org.apache.flink.table.types.DataType accumulatorDataType, boolean hasStateBackedDataViews)
    Modifies the data type of an accumulator regarding data views.
    static org.apache.flink.table.types.DataType
    createDistinctViewDataType(org.apache.flink.table.types.DataType keyDataType, int filterArgs, int filterArgsLimit)
    Creates a special DataType for DISTINCT aggregates.
    createDistinctViewSpec(int index, org.apache.flink.table.types.DataType distinctViewDataType)
    Creates a special DataViewUtils.DistinctViewSpec for DISTINCT aggregates.
    static List<org.apache.flink.table.runtime.dataview.DataViewSpec>
    extractDataViews(int aggIndex, org.apache.flink.table.types.DataType accumulatorDataType)
    Searches for data views in the data type of an accumulator and extracts them.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • extractDataViews

      public static List<org.apache.flink.table.runtime.dataview.DataViewSpec> extractDataViews(int aggIndex, org.apache.flink.table.types.DataType accumulatorDataType)
      Searches for data views in the data type of an accumulator and extracts them.
    • adjustDataViews

      public static org.apache.flink.table.types.DataType adjustDataViews(org.apache.flink.table.types.DataType accumulatorDataType, boolean hasStateBackedDataViews)
      Modifies the data type of an accumulator regarding data views.

      For performance reasons, each data view is wrapped into a RAW type which gives it LazyBinaryFormat semantics and avoids multiple deserialization steps during access. Furthermore, a data view will not be serialized if a state backend is used (the serializer of the RAW type will be a NullSerializer in this case).

    • createDistinctViewDataType

      public static org.apache.flink.table.types.DataType createDistinctViewDataType(org.apache.flink.table.types.DataType keyDataType, int filterArgs, int filterArgsLimit)
      Creates a special DataType for DISTINCT aggregates.
    • createDistinctViewSpec

      public static DataViewUtils.DistinctViewSpec createDistinctViewSpec(int index, org.apache.flink.table.types.DataType distinctViewDataType)
      Creates a special DataViewUtils.DistinctViewSpec for DISTINCT aggregates.