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

   Fixed by classifying the mutating value with the same predicate the 
formatter folds by.
   
   `parse_format_partition_spec` guarded mutating string partition values with 
`text.trim().is_empty()`, while the formatter folds to the default partition 
with `is_java_whitespace_only`. Rust `str::trim` keeps U+001C–U+001F, which 
Java folds, so the two paths disagreed: `DROP PARTITION (label = '<U+001C>')` 
passed the guard, then folded to the default partition name and destroyed the 
NULL partition's registration and directory. The guard now uses 
`is_java_whitespace_only` (exposed as public API for the DataFusion layer), 
matching `PaimonFormatTable.requireNameablePartitionValues`, so any value that 
would fold to the default partition is refused for a mutation. U+180E stays 
nameable, consistent with the formatter keeping it literal — the mutation guard 
and the formatter now share one classifier.
   
   Extended `test_partition_ddl_refuses_blank_string_values` with 
U+001C/U+001E/U+001F for both DROP and ADD, asserting the default partition's 
registration (`SHOW PARTITIONS` = `label=null`) and its directory both survive. 
Non-vacuity: reverting the guard to `trim().is_empty()` makes `DROP PARTITION 
(label='<U+001C>')` return `Ok` and the test fails. Full `paimon` lib (3450) 
and all 22 `rest_format_partition_sql` tests pass; `clippy -p paimon 
--all-targets` and `-p paimon-datafusion --all-targets --features 
fulltext,vortex -D warnings` are clean.
   


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