Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions crates/iceberg/src/arrow/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,8 @@ mod tests {

fn arrow_schema_for_arrow_schema_to_schema_test() -> ArrowSchema {
let fields = Fields::from(vec![
simple_field("key", DataType::Int32, false, "17"),
simple_field("value", DataType::Utf8, true, "18"),
simple_field("key", DataType::Int32, false, "28"),
simple_field("value", DataType::Utf8, true, "29"),
]);

let r#struct = DataType::Struct(fields);
Expand Down Expand Up @@ -1022,9 +1022,9 @@ mod tests {
"required": true,
"type": {
"type": "map",
"key-id": 17,
"key-id": 28,
"key": "int",
"value-id": 18,
"value-id": 29,
"value-required": false,
"value": "string"
}
Expand Down Expand Up @@ -1075,8 +1075,8 @@ mod tests {

fn arrow_schema_for_schema_to_arrow_schema_test() -> ArrowSchema {
let fields = Fields::from(vec![
simple_field("key", DataType::Int32, false, "17"),
simple_field("value", DataType::Utf8, true, "18"),
simple_field("key", DataType::Int32, false, "28"),
simple_field("value", DataType::Utf8, true, "29"),
]);

let r#struct = DataType::Struct(fields);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ mod tests {
),
simple_field("map", map, false, "16"),
simple_field("struct", r#struct, false, "17"),
simple_field("uuid", DataType::FixedSizeBinary(16), false, "26"),
simple_field("uuid", DataType::FixedSizeBinary(16), false, "30"),
])
}

Expand Down Expand Up @@ -1309,9 +1309,9 @@ mod tests {
"required": true,
"type": {
"type": "map",
"key-id": 17,
"key-id": 28,
"key": "int",
"value-id": 18,
"value-id": 29,
"value-required": false,
"value": "string"
}
Expand Down Expand Up @@ -1345,7 +1345,7 @@ mod tests {
}
},
{
"id":26,
"id":30,
"name":"uuid",
"required":true,
"type":"uuid"
Expand Down
6 changes: 6 additions & 0 deletions crates/iceberg/src/spec/datatypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ impl NestedField {
self.write_default = Some(value);
self
}

/// Set the id of the field.
pub(crate) fn with_id(mut self, id: i32) -> Self {
self.id = id;
self
}
}

impl fmt::Display for NestedField {
Expand Down
Loading
Loading