SteNicholas commented on code in PR #1348:
URL: https://github.com/apache/paimon-rust/pull/1348#discussion_r4513210622
##########
crates/integrations/datafusion/src/procedures.rs:
##########
@@ -672,6 +672,27 @@ async fn proc_create_tag(
.transpose()?;
let time_retained = args.get("time_retained").map(String::as_str);
+ // The REST catalog owns tag metadata and resolves the snapshot itself,
+ // including the latest one when `snapshot_id` is omitted.
+ if let Some(rest_env) = table.rest_env() {
Review Comment:
Thanks for the reproduction. Fixed in b86e45de: for REST tables,
`TagManager` now reads and lists tags from the catalog (`RESTEnv::get_tag` /
`list_tag_names`, backed by the new paginated `RESTApi::list_tags`) instead of
tag files, so `$tags`, `VERSION AS OF` and `scan.tag-name` use the same source
as `create_tag`. Catalog errors are returned without falling back to storage,
and `TagManager` storage writes are refused for REST tables.
`test_tag_reads_go_through_rest_catalog` covers the round trip you
suggested: `release` is created in the catalog at snapshot 1 while a stale
`tag-release` file points to snapshot 2, and a `catalog_only` tag has no file.
`$tags`, `VERSION AS OF` and `scan.tag-name` all follow the catalog, a
storage-only tag is not visible, and deleting the tag through the catalog
removes it from reads.
##########
crates/integrations/datafusion/src/procedures.rs:
##########
@@ -672,6 +672,27 @@ async fn proc_create_tag(
.transpose()?;
let time_retained = args.get("time_retained").map(String::as_str);
+ // The REST catalog owns tag metadata and resolves the snapshot itself,
+ // including the latest one when `snapshot_id` is omitted.
+ if let Some(rest_env) = table.rest_env() {
+ return match catalog
+ .create_tag_with_retention(
+ rest_env.identifier(),
+ tag_name,
Review Comment:
Fixed in b86e45de: `RESTApi::create_tag_with_retention` now validates the
tag name with `validate_resource_path`, like get and delete, so `.` and `..`
are rejected before the POST is sent. Covered by
`test_create_tag_goes_through_rest_catalog` (SQL, no request reaches the
catalog) and `version_paths_reject_parent_resources_before_requests` (API).
--
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]