taoran92 opened a new issue, #10512:
URL: https://github.com/apache/paimon/issues/10512

   ### Search before asking
   
   - [x] I searched in the issues and found nothing similar.
   
   ### Paimon version
   
   Master, commit `88d349219be527e9d6127f75bbf8508947b9220b`.
   
   ### Compute Engine
   
   Spark 3.5.9.
   
   ### Minimal reproduce step
   
   Create a partial-update table with two sequence groups whose ordering tuples 
partially overlap:
   
   ```sql
   CREATE TABLE t (
       id INT,
       a INT,
       b INT,
       s INT,
       t_seq INT
   )
   USING paimon
   TBLPROPERTIES (
       'primary-key' = 'id',
       'bucket' = '1',
       'merge-engine' = 'partial-update',
       'fields.s.sequence-group' = 'a',
       'fields.t_seq,s.sequence-group' = 'b'
   );
   
   INSERT INTO t VALUES (1, 100, 100, 10, 10);
   SELECT * FROM t;
   
   INSERT INTO t VALUES (1, 200, 200, 9, 20);
   SELECT * FROM t;
   
   INSERT INTO t VALUES (1, 300, 300, 9, 30);
   SELECT * FROM t;
   ```
   
   The ordering tuple is `s` for the first group and `(t_seq, s)` for the 
second group.
   
   ### What doesn't meet your expectations?
   
   The table is created successfully. The results after each insert are:
   
   ```text
   (1, 100, 100, 10, 10)
   (1, 100, 200, 9, 20)
   (1, 300, 300, 9, 30)
   ```
   
   The first group should reject the third input because its ordering value `s 
= 9` is lower than the version `s = 10` associated with `a = 100`. Instead, the 
second group has already updated the shared stored field `s` to `9`, so the 
first group treats the third input as an equal version and incorrectly updates 
`a` to `300`.
   
   This configuration should fail during table or schema validation with an 
error identifying the shared ordering field and both sequence groups.
   
   ### Anything else?
   
   A sequence group's ordering tuple determines which updates are accepted for 
its protected fields. With partially overlapping tuples such as `s` and 
`(t_seq, s)`, the groups can accept different input rows while both depend on 
the same stored field `s`.
   
   The stored value of `s` then has no unambiguous meaning: it may represent 
the version accepted by one group while another group uses it for its own 
comparisons. This can change whether a later update is accepted. Until the 
semantics of shared ordering fields are explicitly defined, schema validation 
should reject this configuration.
   
   If multiple value fields use the same ordering tuple, they can be configured 
in one sequence group.
   
   ### 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]

Reply via email to