caozhen1937 commented on code in PR #1598:
URL: https://github.com/apache/fluss/pull/1598#discussion_r2303441460


##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/source/FlinkTableSource.java:
##########
@@ -321,6 +342,36 @@ public boolean isBounded() {
         }
     }
 
+    private boolean pushTimeStampFilterToLakeSource(
+            LakeSource<?> lakeSource, RowType flussRowType) {
+        // will push timestamp to lake
+        // we will have three additional system columns, __bucket, __offset, 
__timestamp
+        // in lake, get the  __timestamp index in lake table
+        final int timestampFieldIndex = flussRowType.getFieldCount() + 2;
+        Predicate timestampFilter =
+                new LeafPredicate(
+                        GreaterOrEqual.INSTANCE,
+                        DataTypes.TIMESTAMP_LTZ(),
+                        timestampFieldIndex,
+                        TIMESTAMP_COLUMN_NAME,
+                        Collections.singletonList(
+                                
TimestampLtz.fromEpochMillis(startupOptions.startupTimestampMs)));
+        List<Predicate> acceptedPredicates =
+                lakeSource
+                        
.withFilters(Collections.singletonList(timestampFilter))
+                        .acceptedPredicates();
+        if (acceptedPredicates.isEmpty()) {
+            LOG.warn(
+                    "The lake source doesn't accept the filter {}, won't read 
data from lake.",
+                    timestampFilter);
+            return false;
+        }
+        checkState(
+                acceptedPredicates.size() == 1
+                        && acceptedPredicates.get(0).equals(timestampFilter));

Review Comment:
   Why is an exception being thrown here? If simply check if the 
`timestampFilter` exists, and if it doesn't, return false and log an error, is 
ok?



-- 
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: issues-unsubscr...@fluss.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to