mbutrovich commented on code in PR #3632:
URL: https://github.com/apache/iceberg-rust/pull/3632#discussion_r4667130796


##########
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);

Review Comment:
   > The reader regression test covers `ts`, `ts`, `id`, and `id, ts` for both 
timestamp types, with embedded field IDs and name mapping.
   
   I checked that `test_read_int64_nanosecond_timestamps_as_microseconds` fails 
when the two new arms in `type_promotion_is_valid` are removed, so it covers 
the dropped column.



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