Fokko commented on code in PR #710: URL: https://github.com/apache/iceberg-rust/pull/710#discussion_r1860062199
########## crates/iceberg/src/arrow/schema.rs: ########## @@ -382,12 +382,15 @@ impl ArrowSchemaVisitor for ArrowSchemaConverter { DataType::Time64(unit) if unit == &TimeUnit::Microsecond => { Ok(Type::Primitive(PrimitiveType::Time)) } - DataType::Timestamp(unit, None) if unit == &TimeUnit::Microsecond => { + DataType::Timestamp(unit, None) + if unit == &TimeUnit::Microsecond || unit == &TimeUnit::Nanosecond => + { Ok(Type::Primitive(PrimitiveType::Timestamp)) Review Comment: I don't think this is correct, in the case of the `Nanosecond` Arrow `DataType`, we want to map to `TimestampNs`, otherwise we'll be doing downcasting (that can be okay, as long as the user explicitly wants it, in PyIceberg we control this by explicitly setting a property). Relevant types: https://github.com/apache/iceberg-rust/blob/ce040585b647f8afaccb9f89d3adcbb8c9ec88f7/crates/iceberg/src/spec/datatypes.rs#L369-L370 -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org