walterddr commented on a change in pull request #7237: [FLINK-7209] [table]
Support DataView in Tuple and Case Class as the ACC type of AggregateFunction
URL: https://github.com/apache/flink/pull/7237#discussion_r242392503
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/utils/UserDefinedFunctionUtils.scala
##########
@@ -489,6 +491,88 @@ object UserDefinedFunctionUtils {
)
}
+ def decorateDataViewTypeInfo(
+ fieldTypeInfo: TypeInformation[_],
+ fieldInstance: AnyRef,
+ field: Field): (TypeInformation[_], Option[DataViewSpec[_]]) =
fieldTypeInfo match {
+ case ct: CompositeType[_] if includesDataView(ct) =>
+ throw new TableException(
+ "MapView and ListView only supported at first level of accumulators
of Pojo, Tuple " +
+ "and Case Class type.")
+ case map: MapViewTypeInfo[_, _] =>
+ val mapView = fieldInstance.asInstanceOf[MapView[_, _]]
+ val newTypeInfo = if (mapView != null && mapView.keyTypeInfo != null &&
+ mapView.valueTypeInfo != null) {
+ new MapViewTypeInfo(mapView.keyTypeInfo, mapView.valueTypeInfo)
+ } else {
+ map
+ }
+
+ if (isStateBackedDataViews) {
Review comment:
I was wondering if this is ever needed. since the test case added in this PR
doesn't cover this code path on the else case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services