GeetKrishna commented on code in PR #1617:
URL: https://github.com/apache/iceberg-rust/pull/1617#discussion_r2292568164
##########
crates/iceberg/src/arrow/schema.rs:
##########
@@ -1717,6 +1734,60 @@ mod tests {
}
}
+ #[test]
+ fn test_unsigned_type_casting() {
+ // Test UInt32 → Int64 casting
+ {
+ let arrow_field = Field::new("test", DataType::UInt32,
false).with_metadata(
+ HashMap::from([(PARQUET_FIELD_ID_META_KEY.to_string(),
"1".to_string())]),
+ );
+ let arrow_schema = ArrowSchema::new(vec![arrow_field]);
+
+ let iceberg_schema =
arrow_schema_to_schema(&arrow_schema).unwrap();
+
+ // Verify UInt32 was cast to Long (int64)
+ let iceberg_field =
iceberg_schema.as_struct().fields().first().unwrap();
+ assert!(matches!(
+ iceberg_field.field_type.as_ref(),
+ Type::Primitive(PrimitiveType::Long)
+ ));
+ }
+
+ // Test UInt8/UInt16 → Int32 casting
+ {
+ let arrow_field = Field::new("test", DataType::UInt8,
false).with_metadata(
Review Comment:
I have added this scenario
##########
crates/iceberg/src/arrow/schema.rs:
##########
@@ -1717,6 +1734,60 @@ mod tests {
}
}
+ #[test]
+ fn test_unsigned_type_casting() {
+ // Test UInt32 → Int64 casting
Review Comment:
Done
--
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]