zuston commented on code in PR #3308:
URL: https://github.com/apache/fluss/pull/3308#discussion_r3232751390


##########
fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetcher.java:
##########
@@ -496,6 +514,106 @@ private void pendRemoteFetches(
         }
     }
 
+    private void addLakeFetches(
+            TableBucket tableBucket,
+            LakeLogFetchInfo lakeLogFetchInfo,
+            long firstFetchOffset,
+            long highWatermark) {
+        checkNotNull(lakeLogFetchInfo, "LakeLogFetchInfo is null");
+        try {
+            List<LakeSplit> lakeSplits = planLakeSplits(tableBucket, 
lakeLogFetchInfo);
+            logFetchBuffer.add(
+                    new LakeCompletedFetch(
+                            tableBucket,
+                            createLakeRecordIterator(lakeSplits),
+                            firstFetchOffset,
+                            lakeLogFetchInfo.endOffset(),
+                            highWatermark,
+                            readContext,
+                            logScannerStatus));
+        } catch (Exception e) {
+            throw new FlussRuntimeException(e);
+        }
+    }
+
+    private List<LakeSplit> planLakeSplits(
+            TableBucket tableBucket, LakeLogFetchInfo lakeLogFetchInfo) throws 
IOException {
+        List<LakeSplit> plannedSplits =
+                checkNotNull(lakeSource).createPlanner(() -> 
lakeLogFetchInfo.snapshotId()).plan();
+        List<LakeSplit> lakeSplits = new ArrayList<>();
+        for (LakeSplit lakeSplit : plannedSplits) {
+            // todo: partition + bucket filter and offset column filter could 
be supported in the

Review Comment:
   If this PR is OK, I will submit the following PR to optimize the planning 



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