Repository navigation
Conversation
Contributor
Author
|
@Fokko @rambleraptor could you take a look when you have a moment? this adds ETag-based table caching to RestCatalog, matching Java's rest-table-cache properties. |
Contributor
Author
YuangGao
force-pushed
the
feat/rest-freshness-aware-load
branch
from
November 11, 2026 05:05
546bca0 to
09cf09a
Compare
rambleraptor
suggested changes
Nov 11, 2026
rambleraptor
left a comment
Collaborator
There was a problem hiding this comment.
Adding the lock prevents us from pickling. Thanks for the contribution!
| if ttl_ms <= 0: | ||
| raise ValueError(f"Invalid value for {REST_TABLE_CACHE_EXPIRE_AFTER_WRITE_MS}: {ttl_ms} (must be positive)") | ||
| self._table_cache = TTLCache(maxsize=max_entries, ttl=ttl_ms / 1000) if max_entries > 0 else None | ||
| self._table_cache_lock = threading.Lock() |
Collaborator
There was a problem hiding this comment.
This prevents the table from being pickled.
| def _is_short_lived_credential(key: str) -> bool: | ||
| """Whether a loadTable config key carries a short-lived storage credential.""" | ||
| key = key.lower() | ||
| return key in (S3_SESSION_TOKEN, GCS_TOKEN) or key.startswith(ADLS_SAS_TOKEN) |
Collaborator
There was a problem hiding this comment.
I think we need to add client.session-token, adls.token and token here as well.
Contributor
Author
|
@rambleraptor updated, thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4075
Rationale for this change
load_tablenever sentIf-None-Match, and a body-less304failed to parse.ETagare now cached; a later load sendsIf-None-Matchand returns a freshTablefrom the cached response on304.Are these changes tested?
test_rest.py— reuse on304,304without a cached table, andmax-entries=0.test_rest_catalog.py—200then304against the REST fixture.Are there any user-facing changes?
rest-table-cache.max-entries(default 100,0disables) andrest-table-cache.expire-after-write-ms(default 5 minutes).