etseidl commented on code in PR #11017:
URL: https://github.com/apache/arrow-rs/pull/11017#discussion_r3963309019
##########
parquet/src/schema/types.rs:
##########
@@ -325,22 +336,40 @@ impl<'a> PrimitiveTypeBuilder<'a> {
Self { id, ..self }
}
+ /// Treat incompatible physical/logical type combinations as an unknown
+ /// logical type (physical type, no annotation) instead of erroring.
+ ///
+ /// This is the parquet-format GH-607 reader behavior. Do not use when
+ /// building a schema to write; invalid combinations should still fail.
+ pub(crate) fn with_coerce_incompatible_logical_types(self, value: bool) ->
Self {
+ Self {
+ coerce_incompatible_logical_types: value,
+ ..self
+ }
+ }
+
+ /// Skip physical/logical compatibility checks, keeping the logical type.
+ ///
+ /// Only for tests that need to write a file with an invalid combination.
+ #[cfg(test)]
+ pub(crate) fn with_skip_logical_physical_validation(self, value: bool) ->
Self {
+ Self {
+ skip_logical_physical_validation: value,
+ ..self
+ }
+ }
+
/// Creates a new `PrimitiveType` instance from the collected attributes.
/// Returns `Err` in case of any building conditions are not met.
pub fn build(self) -> Result<Type> {
- let sort_order = ColumnOrder::column_order_for_type(
Review Comment:
This change is almost certainly wrong. Below you are making all sort orders
`SIGNED`.
--
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]