fastio opened a new issue, #497:
URL: https://github.com/apache/paimon-cpp/issues/497
### Search before asking
- [x] I searched in the issues and found nothing similar.
### Paimon-cpp version
main (`42154fcc`)
### Minimal reproduce step
1. Create a table and commit twice, so it has snapshots 1 and 2, each adding
one data file.
2. Read `T$files` with `scan.snapshot-id = 1`:
```cpp
std::map<std::string, std::string> options = {{Options::SCAN_SNAPSHOT_ID,
"1"}};
ScanContextBuilder scan_context_builder(table_path + "$files");
scan_context_builder.SetOptions(options);
// TableScan::Create(...)->CreatePlan(), then read the plan with the same
options
```
3. Read `T$files` with `scan.snapshot-id = 3`, a snapshot that does not
exist.
The same happens with `T$manifests`.
### What doesn't meet your expectations?
Both reads return the files of the latest snapshot (snapshot 2):
- Step 2 returns two files instead of the one file visible in snapshot 1.
- Step 3 succeeds and returns the latest snapshot instead of failing.
`FilesSystemTable` and `ManifestsSystemTable` always call
`SnapshotManager::LatestSnapshot()` and
never look at `scan.snapshot-id`. A caller that pins a snapshot, for example
to read data files
and their metadata from the same snapshot, gets metadata from a newer commit
without any error.
In Paimon Java, `$manifests` resolves its snapshot with
`TimeTravelUtil.tryTravelOrLatest`, and
`$files` plans through the data table scan, so both honor `scan.snapshot-id`.
### Anything else?
The fix only needs `scan.snapshot-id`. Other time travel options
(`scan.tag-name`,
`scan.timestamp-millis`, ...) can be handled separately.
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
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]