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


##########
paimon-core/src/main/java/org/apache/paimon/table/source/DataSplit.java:
##########
@@ -108,6 +108,17 @@ public boolean rawConvertible() {
         return rawConvertible;
     }
 
+    /**
+     * To indicate if this `DataSplit` keep the raw table ordering. For 
example, for the primary key
+     * table, we will do sorted run during write and do merge read during 
read, so the data is
+     * sorted by the primary keys. Return `false` means the ordering is 
broken. If a `DataSplit` is
+     * `rawConvertible` then there is no sort merge read, so only if the data 
file number less than
+     * 2, we can get the correct data ordering.
+     */
+    public boolean keepOrdering() {
+        return !rawConvertible || dataFiles.size() < 2;

Review Comment:
   Maybe we don't need to introduce method here, just use `!rawConvertible || 
dataFiles.size() < 2` in spark.



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