Guosmilesmile commented on code in PR #19115:
URL: https://github.com/apache/iceberg/pull/19115#discussion_r4704231982


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/lookup/IcebergLookupReader.java:
##########
@@ -91,6 +98,62 @@ CloseableIterable<RowData> read(long snapshotId) {
     return new LookupIterable(scan.planTasks(), fileReader);
   }
 
+  CloseableIterable<RowData> readDelta(long fromExclusive, long toInclusive) {

Review Comment:
   Good idea. Merge it now.



##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/lookup/IcebergFullCachingLookupFunction.java:
##########
@@ -270,11 +290,53 @@ private synchronized void loadCache() throws IOException {
 
     LOG.info(
         "IcebergFullCachingLookupFunction loading finished, snapshot={}, 
rows={}, cost={} ms",
-        snapshot == null ? "none" : snapshotId,
+        snapshotId,
         rowCnt,
         loadTimeMs);
   }
 
+  private void loadDelta(long fromExclusive, long toInclusive) throws 
IOException {

Review Comment:
   Merge it now. 



##########
docs/docs/flink-queries.md:
##########
@@ -128,7 +128,11 @@ LEFT JOIN iceberg_catalog.db.user_dim /*+ 
OPTIONS('lookup.full-cache.reload-stra
   ON o.user_id = u.user_id;
 ```
 
-A reload reads the current snapshot of the dimension table and replaces the 
loaded cache atomically, so lookups observe either the previous cache or the 
new one, never a partially loaded cache. A reload that finds no new snapshot is 
a no-op, and the reload strategies also run once when the lookup function is 
opened, which is a no-op as well when the cache has not been loaded yet or the 
snapshot has not changed. Reloads run on the trigger's own thread while lookups 
keep being served from the previous cache, so they do not block the job; both 
caches are held in memory until the reload finishes, so peak memory is about 
twice the cache size. A reload never falls back to the previous cache: if a 
reload fails, the next lookup fails the job, so a stale cache is never served 
silently.
+A reload replaces the loaded cache atomically, so lookups see either the 
previous cache or the new one, never a partial one. Lookups keep being served 
from the previous cache while a reload runs. A reload that finds no new 
snapshot is a no-op. If a reload fails, the next lookup fails the job, so a 
stale cache is never served silently.

Review Comment:
   Initially, I wanted to simplify this section, but on second thought, I think 
these two pieces of information are still important for users to know.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to