Fokko commented on code in PR #21:
URL: https://github.com/apache/iceberg-rust/pull/21#discussion_r1284136902
##########
crates/iceberg/src/spec/datatypes.rs:
##########
@@ -533,30 +655,87 @@ mod tests {
record,
Type::Struct(StructType {
fields: vec![
- StructField {
- id: 1,
- name: "id".to_string(),
- required: true,
- field_type: Type::Primitive(PrimitiveType::Uuid),
- doc: None,
- initial_default:
Some("0db3e2a8-9d1d-42b9-aa7b-74ebe558dceb".to_string()),
- write_default:
Some("ec5911be-b0a7-458c-8438-c9a3e53cffae".to_string()),
- },
- StructField {
- id: 2,
- name: "data".to_string(),
- required: false,
- field_type: Type::Primitive(PrimitiveType::Int),
- doc: None,
- initial_default: None,
- write_default: None,
- },
+ NestedField::required(1, "id",
Type::Primitive(PrimitiveType::Uuid))
+
.with_initial_default("0db3e2a8-9d1d-42b9-aa7b-74ebe558dceb")
+
.with_write_default("ec5911be-b0a7-458c-8438-c9a3e53cffae"),
+ NestedField::optional(2, "data",
Type::Primitive(PrimitiveType::Int)),
],
id_lookup: HashMap::from([(1, 0), (2, 1)]).into(),
}),
)
}
+ #[test]
+ fn test_deeply_nested_struct() {
Review Comment:
These tests are great! In Python we use the `table_schema_nested`, that has
everything, a `list`, `map` and a nested field:
https://github.com/apache/iceberg/blob/master/python/tests/conftest.py#L130-L178
--
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]