sam-1112 commented on code in PR #3632:
URL: https://github.com/apache/iceberg-rust/pull/3632#discussion_r4665479321


##########
crates/iceberg/src/arrow/int96.rs:
##########
@@ -44,66 +50,69 @@ use crate::{Error, ErrorKind};
 pub(crate) fn coerce_int96_timestamps(
     arrow_schema: &ArrowSchemaRef,
     iceberg_schema: &Schema,
-) -> Option<Arc<ArrowSchema>> {
-    let mut visitor = Int96CoercionVisitor::new(iceberg_schema);
-    let coerced = visit_schema(arrow_schema, &mut visitor).ok()?;
-    if visitor.changed {
-        Some(Arc::new(coerced))
-    } else {
-        None
+    parquet_schema: &SchemaDescriptor,
+) -> Result<Option<Arc<ArrowSchema>>> {
+    if !parquet_schema
+        .columns()
+        .iter()
+        .any(|column| column.physical_type() == PhysicalType::INT96)
+    {
+        return Ok(None);
     }
+    let mut visitor = Int96CoercionVisitor::new(iceberg_schema, 
parquet_schema);
+    let coerced = visit_schema(arrow_schema, &mut visitor)?;

Review Comment:
   I’ve added traversal support for `ListView` and `LargeListView`, preserving 
their types and consuming their element leaves in file order. The leaf-count 
check remains in place.
   
   The end-to-end regression test covers both list-view types: selecting only 
`id` returns 42, and selecting `ts, id` also verifies that the following INT96 
column is coerced correctly. Both cases pass.



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