Class DataViewUtils
- java.lang.Object
-
- org.apache.flink.table.planner.typeutils.DataViewUtils
-
@Internal public final class DataViewUtils extends Object
Utilities to deal withDataView
s.A
DataView
is either represented as a regularStructuredType
or as aRawType
that serializes tonull
when backed by a state backend. In the latter case, aDataViewSpec
contains all information necessary to store and retrieve data from state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataViewUtils.DistinctViewSpec
Specification for a specialMapView
for deduplication.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataType
adjustDataViews(DataType accumulatorDataType, boolean hasStateBackedDataViews)
Modifies the data type of an accumulator regarding data views.static DataType
createDistinctViewDataType(DataType keyDataType, int filterArgs, int filterArgsLimit)
Creates a specialDataType
for DISTINCT aggregates.static DataViewUtils.DistinctViewSpec
createDistinctViewSpec(int index, DataType distinctViewDataType)
Creates a specialDataViewUtils.DistinctViewSpec
for DISTINCT aggregates.static List<DataViewSpec>
extractDataViews(int aggIndex, DataType accumulatorDataType)
Searches for data views in the data type of an accumulator and extracts them.
-
-
-
Method Detail
-
extractDataViews
public static List<DataViewSpec> extractDataViews(int aggIndex, DataType accumulatorDataType)
Searches for data views in the data type of an accumulator and extracts them.
-
adjustDataViews
public static DataType adjustDataViews(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 aNullSerializer
in this case).
-
createDistinctViewDataType
public static DataType createDistinctViewDataType(DataType keyDataType, int filterArgs, int filterArgsLimit)
Creates a specialDataType
for DISTINCT aggregates.
-
createDistinctViewSpec
public static DataViewUtils.DistinctViewSpec createDistinctViewSpec(int index, DataType distinctViewDataType)
Creates a specialDataViewUtils.DistinctViewSpec
for DISTINCT aggregates.
-
-