JingsongLi commented on code in PR #7886:
URL: https://github.com/apache/paimon/pull/7886#discussion_r3281276978


##########
paimon-core/src/main/java/org/apache/paimon/append/AppendOnlyWriter.java:
##########
@@ -159,11 +164,18 @@ public AppendOnlyWriter(
         this.statsCollectorFactories = statsCollectorFactories;
         this.maxDiskSize = maxDiskSize;
         this.fileIndexOptions = fileIndexOptions;
+        this.coreOptions = coreOptions;
 
-        this.sinkWriter =
-                useWriteBuffer
-                        ? createBufferedSinkWriter(spillable)
-                        : new DirectSinkWriter<>(this::createRollingRowWriter);
+        // Determine if we need to enable sorting based on clustering 
configuration
+        List<String> clusteringColumns = coreOptions.clusteringColumns();
+        this.sortEnabled =
+                coreOptions.clusteringIncrementalEnabled()
+                        && coreOptions.clusteringIncrementalOptimizeWrite()
+                        && coreOptions.clusteringIncrementalMode()
+                                == 
CoreOptions.ClusteringIncrementalMode.LOCAL_SORT

Review Comment:
   I feel it's okay. Local sorting can just do its best to sort, whether at the 
task level or file level. We can add comments to explain.



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