JingsongLi commented on PR #956:
URL: https://github.com/apache/paimon-rust/pull/956#issuecomment-5935883600

   Production review found one P2 validation gap in 
`Schema::validate_bucket_count` (`crates/paimon/src/spec/schema.rs`, around 
line 1244).
   
   The new validator trims the value before parsing, but 
`CoreOptions::bucket()` parses the original persisted string without trimming 
and falls back to `-1` on a parse failure. Consequently, `bucket=" 4 "` passes 
create/alter validation but selects dynamic bucketing at runtime. This leaves 
the silent fallback that this PR aims to prevent reachable through the newly 
accepted input grammar. The runtime fallback already existed; the issue here is 
the incomplete validation contract.
   
   I reproduced this through a native primary-key table: create with `bucket=" 
4 "`, write four rows, prepare/commit and read them back. The persisted 
manifest entries have `total_buckets = -1`; the same flow with `bucket="4"` 
records `4`. The regression assertion fails on this head. A temporary control 
removing the validator's `.trim()` passes, rejecting the padded value before 
creating the table and preserving the valid fixed-bucket write. Either use the 
existing runtime/Java integer grammar for validation or normalize the value 
consistently before persisting and consuming it.
   
   Validation: all 128 existing schema/schema-change tests passed; the 
additional real write/commit/read probe reproduced the mismatch. Please add 
coverage that checks the resulting bucket mode, including the alter-options 
path.
   


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