Class DataViewUtils
- java.lang.Object
 - 
- org.apache.flink.table.runtime.dataview.DataViewUtils
 
 
- 
@Internal public final class DataViewUtils extends Object
Utilities to deal withDataViews.For aggregating functions: A
DataViewis a field that is either represented as a regularStructuredTypeor as aRawTypethat serializes tonullwhen backed by a state backend. In the latter case, aDataViewSpeccontains all information necessary to store and retrieve data from state.For process table functions: A
DataViewis a top-level instance that is always backed by a state backend. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataViewUtils.DistinctViewSpecSpecification for a specialMapViewfor deduplication. 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.flink.table.types.DataTypeadjustDataViews(org.apache.flink.table.types.DataType accumulatorDataType, boolean hasStateBackedDataViews)Modifies the data type of an accumulator regarding data views.static voidcheckForInvalidDataViews(org.apache.flink.table.types.logical.LogicalType type)Checks that the given type and its children do not contain data views.static org.apache.flink.table.types.DataTypecreateDistinctViewDataType(org.apache.flink.table.types.DataType keyDataType, int filterArgs, int filterArgsLimit)Creates a specialDataTypefor DISTINCT aggregates.static DataViewUtils.DistinctViewSpeccreateDistinctViewSpec(int index, org.apache.flink.table.types.DataType distinctViewDataType)Creates a specialDataViewUtils.DistinctViewSpecfor DISTINCT aggregates.static List<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.static booleanisDataView(org.apache.flink.table.types.logical.LogicalType viewType, Class<? extends org.apache.flink.table.api.dataview.DataView> viewClass)Returns whether the givenLogicalTypequalifies as aDataView. 
 - 
 
- 
- 
Method Detail
- 
isDataView
public static boolean isDataView(org.apache.flink.table.types.logical.LogicalType viewType, Class<? extends org.apache.flink.table.api.dataview.DataView> viewClass)Returns whether the givenLogicalTypequalifies as aDataView. 
- 
checkForInvalidDataViews
public static void checkForInvalidDataViews(org.apache.flink.table.types.logical.LogicalType type)
Checks that the given type and its children do not contain data views. 
- 
extractDataViews
public static List<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
LazyBinaryFormatsemantics 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 aNullSerializerin 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 specialDataTypefor DISTINCT aggregates. 
- 
createDistinctViewSpec
public static DataViewUtils.DistinctViewSpec createDistinctViewSpec(int index, org.apache.flink.table.types.DataType distinctViewDataType)
Creates a specialDataViewUtils.DistinctViewSpecfor DISTINCT aggregates. 
 - 
 
 -