DanielLeens commented on issue #13407:
URL: https://github.com/apache/seatunnel/issues/13407#issuecomment-7162169039

   Classification: F / Connector-V2 JDBC conditional-update correctness 
contract.
   
   The PostgreSQL-only first slice is a reasonable direction, and a reserved 
target-table alias is clearer than an ambiguous bare column. For that slice, 
`:update_time > target.update_time` can be the user-facing form only if the 
implementation resolves `:update_time` from the known incoming schema to safely 
quoted `EXCLUDED.<column>` and reserves `target.<column>` for the stored row. 
Do not implement this with raw textual substitution or accept arbitrary 
identifier expansion.
   
   The current PostgreSQL dialect already builds `INSERT ... ON CONFLICT (...) 
DO UPDATE SET ... = EXCLUDED...`, so the predicate belongs only on that `DO 
UPDATE ... WHERE` branch. The contract must state that a missing key still 
inserts, while a false or NULL predicate is a successful no-op — not a row 
error, retry, or an accidental insert.
   
   There is one blocker to settle before a PR: the normal JDBC path uses 
`BufferReducedBatchStatementExecutor`, which deliberately retains only the last 
change for a key in a batch. Therefore a per-row SQL predicate alone cannot 
provide the ordering guarantee in the example. Please define and test the 
same-key-in-one-batch behavior first, including both `older -> newer` and 
`newer -> older` input order, then choose the smallest safe executor behavior 
for this option.
   
   Keep the initial scope to PostgreSQL, unchanged behavior when the option is 
absent, a PostgreSQL container regression for 
insert/update/false/NULL/duplicate-key cases, and matching EN/ZH documentation. 
Other dialects should remain separate follow-up work.
   


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