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


##########
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:
   **[P1] Resolve REST tags through the catalog on the read path**
   
   This changes `create_tag` to write through the catalog, while `$tags` and 
`VERSION AS OF` still read tag files from table storage. I reproduced a case 
where `CALL sys.create_tag(table => 'sales.orders', tag => 'release', 
snapshot_id => 1)` succeeded, but an old `tag-release` file pointed to snapshot 
2. `$tags` reported snapshot 2 and `VERSION AS OF 'release'` silently returned 
snapshot 2's rows. With no tag file, `$tags` omitted the tag and time travel 
failed.
   
   Could the REST paths for listing and resolving tags use the same catalog as 
the write path? A SQL round-trip test with a catalog-only tag and a stale 
same-name file would cover both cases.



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