Skip to content

Commit 9c60f72

Browse files
committed
speed up partition struct casting
1 parent 7cf46a8 commit 9c60f72

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

iceberg-rust-spec/src/spec/values.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ impl Struct {
222222
schema: &StructType,
223223
partition_spec: &[PartitionField],
224224
) -> Result<Self, Error> {
225+
if self.fields.is_empty() {
226+
return Ok(self);
227+
}
225228
// Returns a HashMap mapping partition field names to transformed types.
226229
let map = partition_spec
227230
.iter()

0 commit comments

Comments
 (0)