leo65535 commented on code in PR #702:
URL: https://github.com/apache/incubator-paimon/pull/702#discussion_r1147036936
##########
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:
hi, it will be more complex if we do that, so let's keep it.
--
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]