NestDream commented on PR #9944:
URL: https://github.com/apache/paimon/pull/9944#issuecomment-5722987117

   Repro in Flink SQL (any 1.19+ SQL client with a Paimon catalog, tested on 
master 8b7fbffcc):
   
   ```sql
   CREATE TABLE T (id STRING, name STRING, PRIMARY KEY (id) NOT ENFORCED) WITH 
('bucket' = '1');
   INSERT INTO T VALUES ('1', 'a');
   INSERT INTO T VALUES ('2', 'b');
   INSERT INTO T VALUES ('3', 'c');
   CALL sys.create_tag(`table` => 'default.T', tag => 'tag-1', snapshot_id => 
1);
   
   -- 1. neither argument: bare NPE instead of an argument error
   CALL sys.rollback_to(`table` => 'default.T');
   -- TableException: The call method caused an error: Cannot invoke 
"java.lang.Long.longValue()" because "snapshotId" is null.
   -- (on JDK 11 the message is just "The call method caused an error: null.")
   
   -- 2. both arguments: succeeds, silently rolls back to the tag (snapshot 1) 
and ignores snapshot_id = 2
   CALL sys.rollback_to(`table` => 'default.T', tag => 'tag-1', snapshot_id => 
2);
   -- returns (3, 1); SELECT * FROM T now shows only ('1','a')
   ```
   
   With this PR both calls fail with `IllegalArgumentException: Must specify 
exactly one of tag and snapshot_id.` and the table is left untouched.
   


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