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


##########
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:
   Thanks for the reproducer. I’ve kept INT64 nanosecond columns at their 
original precision and updated projection to allow `timestamp_ns` → `timestamp` 
and `timestamptz_ns` → `timestamptz`, so the values reach the existing cast.
   
   The reader regression test covers `ts`, `ts`, `id`, and `id, ts` for both 
timestamp types, with embedded field IDs and name mapping. All cases pass. I 
also ran the original #3616 reproducer and confirmed the expected values for 
both types, so I’ve retained `Closes #3616`.
   



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