fmorillo7694 opened a new pull request, #18917:
URL: https://github.com/apache/iceberg/pull/18917

   Follow-up to #17900, as suggested in 
https://github.com/apache/iceberg/pull/17900#discussion_r4184663542. Changing a 
column to or from `variant` is not a valid type promotion, but 
`DynamicIcebergSink` only found out while it was already building the schema 
update: a check inside `EvolveSchemaVisitor` caught `string -> variant`, and 
`UpdateSchema` caught `variant -> string`. `TableUpdater.findOrCreateSchema` 
now rejects both before the update starts, with one error that names the column 
and the table, and the check in `EvolveSchemaVisitor` is removed. This targets 
Flink 2.3; the Flink 2.2 backport applies cleanly and will follow as a separate 
PR.
   
   Test plan: a new parameterized test in `TestTableUpdater` covers both 
directions. Each case must throw the new error, and the table schema must stay 
unchanged even though the incoming schema also adds a column. With the check 
disabled, both cases fail. The existing Variant tests in 
`TestEvolveSchemaVisitor`, `TestCompareSchemasVisitor` and 
`TestDynamicIcebergSink` still pass.
   
   ---
   **AI Disclosure**
   - Model: Claude (Anthropic)
   - Platform/Tool: Kiro (Kiro Crew)
   - Human Oversight: partially reviewed
   - Prompt Summary: Implement the follow-up promised on #17900: fail early in 
`TableUpdater.findOrCreateSchema` for variant column type changes, with a 
focused unit test. The validation code and its test are generated.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to