JingsongLi commented on code in PR #1348:
URL: https://github.com/apache/paimon-rust/pull/1348#discussion_r4511494964


##########
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:
   **[P2] Reject dot-segment tag names before creating them over REST**
   
   The REST create API sends the tag name in the JSON body and only checks that 
it is nonblank. `get_tag` and `delete_tag` reject `.` and `..` before sending a 
request because these names are URL path segments. With this PR's mock, `CALL 
sys.create_tag(table => 'sales.orders', tag => '..')` succeeds, then `CALL 
sys.delete_tag(table => 'sales.orders', tag => '..')` fails and leaves the tag 
in the catalog.
   
   Could `create_tag_with_retention` apply the same tag-name validation as get 
and delete before issuing the POST?



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

Reply via email to