hutiefang76 opened a new issue, #4419:
URL: https://github.com/apache/amoro/issues/4419

   ### What happened?
   
   Making a column required produces `DROP NOT NULL` in table-operation 
history; making it optional produces `SET NOT NULL`. The recorded Spark DDL 
expresses the opposite of the metadata change.
   
   ### Affects Versions
   
   master at 061eb724e93592fe87cf44b61af34c1d799f5db6 (0.9-SNAPSHOT). No claim 
about untested releases.
   
   ### What table formats are you seeing the problem on?
   
   Iceberg and Paimon descriptor paths.
   
   ### What engines are you seeing the problem on?
   
   AMS table-operation history, using the Spark DDL formatter.
   
   ### How to reproduce
   
   Call `new SparkMetadataChangeHandler("tbl").changeColumnsRequire("c", true)`.
   
   Actual: `ALTER TABLE tbl ALTER COLUMN c DROP NOT NULL`.
   Expected: `ALTER TABLE tbl ALTER COLUMN c SET NOT NULL`.
   
   Repeat with `false`: the expected operation is `DROP NOT NULL`. The same 
reversal is observable through `DDLReverser` using two metadata snapshots with 
opposite required flags.
   
   ### Relevant log output
   
   This is a deterministic metadata/DDL conversion error, reproduced without a 
running cluster. The before/expected values are shown above.
   
   ### Anything else
   
   A small fix and regression tests are ready.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR.
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct.
   
   AI assistance: DeepSeek and Codex assisted reproduction, implementation, 
tests and this description.
   


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