sunchao commented on code in PR #24525:
URL: https://github.com/apache/datafusion/pull/24525#discussion_r3837577918


##########
datafusion/datasource-parquet/src/metadata.rs:
##########
@@ -57,6 +58,54 @@ use std::sync::Arc;
 /// would be too unreliable otherwise.
 const PARTIAL_NDV_THRESHOLD: f64 = 0.75;
 
+fn requires_unsigned_byte_array_order(column: &ColumnDescriptor) -> bool {
+    matches!(
+        column.physical_type(),
+        PhysicalType::BYTE_ARRAY | PhysicalType::FIXED_LEN_BYTE_ARRAY
+    ) && column.sort_order() != SortOrder::SIGNED
+}
+
+/// Whether byte-array bounds lack a recognized unsigned comparison order.
+///
+/// The deprecated Parquet `min`/`max` fields use signed comparison, unlike
+/// Arrow's string and binary comparisons. Even the modern bounds cannot be
+/// interpreted without the corresponding footer `column_orders` entry.
+/// Signed logical types, such as decimals, retain their existing behavior.
+pub(crate) fn has_untrusted_byte_array_order(

Review Comment:
   Good catch — I will update the guard to reject undefined sort orders, 
including INT96, and add a regression test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to