@Internal public final class DataViewUtils extends Object
DataView
s.
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
DataViewUtils.DataViewSpec
contains all information necessary to store and retrieve data from state.
Modifier and Type | Class and Description |
---|---|
static class |
DataViewUtils.DataViewSpec
Information about a
DataView stored in state. |
static class |
DataViewUtils.DistinctViewSpec
Specification for a special
MapView for deduplication. |
static class |
DataViewUtils.ListViewSpec
Specification for a
ListView . |
static class |
DataViewUtils.MapViewSpec
Specification for a
MapView . |
Modifier and Type | Method and 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 special
DataType for DISTINCT aggregates. |
static DataViewUtils.DistinctViewSpec |
createDistinctViewSpec(int index,
DataType distinctViewDataType)
Creates a special
DataViewUtils.DistinctViewSpec for DISTINCT aggregates. |
static List<DataViewUtils.DataViewSpec> |
extractDataViews(int aggIndex,
DataType accumulatorDataType)
Searches for data views in the data type of an accumulator and extracts them.
|
static DataType |
extractElementDataTypeForListView(DataType dataType) |
static KeyValueDataType |
extractKeyValueDataTypeForMapView(DataType dataType) |
static boolean |
isDataView(LogicalType t,
Class<? extends DataView> viewClass) |
static boolean |
isListViewDataType(DataType dataType)
Check if the given data type represents a
ListView . |
static boolean |
isMapViewDataType(DataType dataType)
Check if the given data type represents a
MapView . |
public static List<DataViewUtils.DataViewSpec> extractDataViews(int aggIndex, DataType accumulatorDataType)
public static DataType adjustDataViews(DataType accumulatorDataType, boolean hasStateBackedDataViews)
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).
public static DataType createDistinctViewDataType(DataType keyDataType, int filterArgs, int filterArgsLimit)
DataType
for DISTINCT aggregates.public static DataViewUtils.DistinctViewSpec createDistinctViewSpec(int index, DataType distinctViewDataType)
DataViewUtils.DistinctViewSpec
for DISTINCT aggregates.public static boolean isDataView(LogicalType t, Class<? extends DataView> viewClass)
public static boolean isListViewDataType(DataType dataType)
ListView
. This method must be in sync with
ListView.newListViewDataType(DataType)
.public static DataType extractElementDataTypeForListView(DataType dataType)
public static boolean isMapViewDataType(DataType dataType)
MapView
. This method must be in sync with
MapView.newMapViewDataType(DataType, DataType)
.public static KeyValueDataType extractKeyValueDataTypeForMapView(DataType dataType)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.