zhuangchong commented on code in PR #702:
URL: https://github.com/apache/incubator-paimon/pull/702#discussion_r1147012584


##########
paimon-core/src/main/java/org/apache/paimon/table/system/SnapshotsTable.java:
##########
@@ -194,11 +195,18 @@ public RecordReader<InternalRow> createReader(Split 
split) throws IOException {
             Path location = ((SnapshotsSplit) split).location;
             Iterator<Snapshot> snapshots = new SnapshotManager(fileIO, 
location).snapshots();
             Iterator<InternalRow> rows = Iterators.transform(snapshots, 
this::toRow);
-            if (projection != null) {
+
+            if (projection != null && projection.length != 0) {
                 rows =
                         Iterators.transform(
                                 rows, row -> 
ProjectedRow.from(projection).replaceRow(row));
             }
+
+            rows =
+                    Arrays.stream(Iterators.toArray(rows, InternalRow.class))
+                            .sorted(Comparator.comparingLong(row -> 
row.getLong(0)))
+                            .iterator();
+

Review Comment:
   Is it better to proactively add an order statement to the query sql?



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