jackylee-ch commented on PR #975:
URL: https://github.com/apache/paimon-rust/pull/975#issuecomment-5969391335

   Fixed by guarding the add symmetrically with the drop.
   
   The earlier guard only covered dropping a non-trailing column; an ADD that 
lands anywhere but last shifts existing CSV physical columns the same way. On a 
`(id, label)` CSV format table holding `1,old`, `ADD extra AFTER id` now fails 
up front with "it shifts the physical column positions of existing files" 
instead of letting the permissive reader decode the old row as `(id, extra, 
label) = (1, "old", NULL)` and making `WHERE label = 'old'` return nothing. 
Appending a column (plain ADD, or an explicit move to last) stays allowed, so 
old files pad it with null and permissive decoding only ever drops genuinely 
extra trailing fields.
   
   Regression `test_csv_format_table_rejects_adding_non_trailing_column`: on a 
`(id, label)` CSV format table, adding `extra` AFTER `id` and adding it FIRST 
are both rejected, while a plain append and a move-to-last succeed. 
Non-vacuity: disabling the guard lets `ADD extra AFTER id` through and the test 
fails. The full `paimon` lib suite (3520) passes and `clippy -p paimon 
--all-targets -D warnings` is clean. A standalone same-width reorder is the 
separate pre-existing concern you noted and is left as is.
   


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