fix: fix boolean inline constant decoding#5862
Conversation
Support decoding DataType::Boolean inline scalar values and add regression tests.
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
Code ReviewP0 Issue: Silent data corruption risk with debug_assertLocation: The PR removes runtime validation and replaces it with
Recommendation: Keep the original runtime validation. While the PR description says this is "per maintainer preference", the trade-off here favors safety. At minimum, the length check should remain as a runtime error: // Keep runtime validation for boolean
if matches\!(data_type, DataType::Boolean) {
if inline_value.len() \!= 1 {
return Err(ArrowError::InvalidArgumentError(format\!(
"Invalid boolean inline scalar length (expected 1 byte, got {})",
inline_value.len()
)));
}
} else {
let byte_width = data_type.byte_width_opt().ok_or_else(|| {
ArrowError::InvalidArgumentError(format\!(
"Inline constant is not supported for non-fixed-stride data type {:?}",
data_type
))
})?;
if inline_value.len() \!= byte_width {
return Err(ArrowError::InvalidArgumentError(format\!(
"Inline constant length mismatch for {:?}: expected {} bytes but got {}",
data_type, byte_width, inline_value.len()
)));
}
}P1 Issue: Missing test for
|
Use std::iter::repeat_n per clippy::manual_repeat_n.
|
Test failed for: It's another flaky test and not related to my changes, |
This fixes a regression where reading a dataset could fail with: `Inline constant is not supported for non-fixed-stride data type Boolean` --- **Parts of this PR were drafted with assistance from Codex (with `gpt-5.2`) and fully reviewed and edited by me. I take full responsibility for all changes.**
This fixes a regression where reading a dataset could fail with:
Inline constant is not supported for non-fixed-stride data type BooleanParts of this PR were drafted with assistance from Codex (with
gpt-5.2) and fully reviewed and edited by me. I take full responsibility for all changes.