weimingdiit commented on code in PR #6983:
URL: https://github.com/apache/hudi/pull/6983#discussion_r1008954486


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/execution/CopyOnWriteInsertHandler.java:
##########
@@ -69,28 +73,29 @@ public CopyOnWriteInsertHandler(HoodieWriteConfig config, 
String instantTime,
 
   @Override
   public void consumeOneRecord(HoodieInsertValueGenResult<HoodieRecord> 
payload) {
-    final HoodieRecord insertPayload = payload.record;
+    final HoodieRecord<T> insertPayload = payload.record;
     String partitionPath = insertPayload.getPartitionPath();
     HoodieWriteHandle<?,?,?,?> handle = handles.get(partitionPath);
-    if (handle == null) {
-      // If the records are sorted, this means that we encounter a new 
partition path
-      // and the records for the previous partition path are all written,
-      // so we can safely closely existing open handle to reduce memory 
footprint.
-      if (areRecordsSorted) {
-        closeOpenHandles();
+    if (handle == null || !handle.canWrite(payload.record)) {
+      if (handle == null) {

Review Comment:
   @xushiyan  how about this? If  worried about causing other hidden problems, 
I can change the code , revert logic flow and  return early



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