Au-Miner commented on code in PR #25789:
URL: https://github.com/apache/flink/pull/25789#discussion_r1883583419
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecGroupTableAggregate.java:
##########
@@ -120,16 +119,16 @@ protected Transformation<RowData> translateToPlanInternal(
final AggsHandlerCodeGenerator generator =
new AggsHandlerCodeGenerator(
- new CodeGeneratorContext(
- config,
planner.getFlinkContext().getClassLoader()),
- planner.createRelBuilder(),
-
JavaScalaConversionUtil.toScala(inputRowType.getChildren()),
- // TODO: heap state backend do not copy key
currently,
- // we have to copy input field
- // TODO: copy is not need when state backend
is rocksdb,
- // improve this in future
- // TODO: but other operators do not copy this
input field.....
- true)
+ new CodeGeneratorContext(
+ config,
planner.getFlinkContext().getClassLoader()),
+ planner.createRelBuilder(),
+
JavaScalaConversionUtil.toScala(inputRowType.getChildren()),
+ // TODO: heap state backend do not copy key currently,
Review Comment:
Currently, sync and asynchronous use different versions of state objects. In
consideration of
https://github.com/apache/flink/commit/bccace0f4b233e10279c7d95e009ae6aadad5ae8,
the design concept is to design another set of corresponding files and reuse
the code logic as much as possible in `Helper`
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/aggregate/asyncprocessing/AsyncStateGroupTableAggFunction.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.runtime.operators.aggregate.asyncprocessing;
+
+import org.apache.flink.api.common.functions.OpenContext;
+import org.apache.flink.api.common.state.StateTtlConfig;
+import org.apache.flink.api.common.state.v2.ValueState;
+import org.apache.flink.runtime.state.v2.ValueStateDescriptor;
+import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
+import org.apache.flink.streaming.api.operators.StreamingRuntimeContext;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.runtime.dataview.PerKeyStateDataViewStore;
+import
org.apache.flink.table.runtime.generated.GeneratedTableAggsHandleFunction;
+import org.apache.flink.table.runtime.generated.TableAggsHandleFunction;
+import org.apache.flink.table.runtime.operators.aggregate.RecordCounter;
+import
org.apache.flink.table.runtime.operators.aggregate.utils.GroupTableAggHelper;
+import org.apache.flink.table.runtime.typeutils.InternalTypeInfo;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.util.Collector;
+
+import static
org.apache.flink.table.runtime.util.StateConfigUtil.createTtlConfig;
+
+/** Aggregate Function used for the groupby (without window) table aggregate
in async state. */
+public class AsyncStateGroupTableAggFunction
Review Comment:
Currently, sync and asynchronous use different versions of state objects. In
consideration of
https://github.com/apache/flink/commit/bccace0f4b233e10279c7d95e009ae6aadad5ae8,
the design concept is to design another set of corresponding files and reuse
the code logic as much as possible in `Helper`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]