masteryhx commented on code in PR #23344:
URL: https://github.com/apache/flink/pull/23344#discussion_r1318247491


##########
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/SavepointReaderITTestBase.java:
##########
@@ -293,11 +293,7 @@ public void processBroadcastElement(Integer value, Context 
ctx, Collector<Void>
 
         @Override
         public void snapshotState(FunctionSnapshotContext context) throws 
Exception {
-            listState.clear();
-
-            listState.addAll(elements);
-
-            unionState.clear();
+            listState.update(elements);
 
             unionState.addAll(elements);

Review Comment:
   ```suggestion
               unionState.update(elements);
   ```



##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/sort/StreamSortOperator.java:
##########
@@ -123,14 +123,12 @@ public void initializeState(StateInitializationContext 
context) throws Exception
     @Override
     public void snapshotState(StateSnapshotContext context) throws Exception {
         super.snapshotState(context);
-        // clear state first
-        bufferState.clear();
 
         List<Tuple2<RowData, Long>> dataToFlush = new 
ArrayList<>(inputBuffer.size());
         inputBuffer.forEach((key, value) -> dataToFlush.add(Tuple2.of(key, 
value)));
 
         // batch put

Review Comment:
   ```suggestion
           // batch update
   ```



-- 
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]

Reply via email to