raghav-reglobe commented on PR #2754:
URL: https://github.com/apache/iceberg-rust/pull/2754#issuecomment-4877198985
Thanks for digging into this — running temp tests against the branch head is
exactly the check this needed, and you're right that the contract was implicit.
The directory-style behavior is intentional, so I've gone with your option 1
and made it explicit. Two reasons: the intended callers are maintenance
operations (listing a table location or its `data/`/`metadata/` directories for
orphan-file cleanup), and it's also the semantics OpenDAL gives us naturally —
supporting raw object-key prefix matching would mean fighting the underlying
library for a case no caller needs. Rather than inherit the "may be either,
depending on the implementation" ambiguity from `SupportsPrefixOperations`, the
contract is now pinned to directory-style uniformly:
- docs on `FileIO::list_prefix` (and the `Storage` trait) spell out the
normalization: a prefix without a trailing `/` gets one appended, so
`list_prefix("…/t")` ≡ `list_prefix("…/t/")`, a path naming an existing file
yields an empty list (`exists()` is the tool for that), and a missing prefix is
empty rather than an error;
- added the regression tests you suggested for `MemoryStorage` and
`LocalFsStorage`, asserting the exact-file-path case returns empty plus the
trailing-slash equivalence.
Pushed as 4bc0260a. If you think there's a real caller for the Hadoop-style
"exact file path returns itself" edge, happy to reconsider — but one fixed
semantic seems better than implementation-defined here.
--
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]