Skip to content

Commit 1d19c78

Browse files
author
ZENOTME
committed
use field nullable instead of array nullable
1 parent 8c46815 commit 1d19c78

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/iceberg/src/arrow/value.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,14 @@ fn visit_arrow_struct_array<V: ArrowArrayVistor>(
399399

400400
let mut columns = Vec::with_capacity(array.columns().len());
401401

402-
for ((array, arrow_type), iceberg_field) in array
402+
for ((array, arrow_field), iceberg_field) in array
403403
.columns()
404404
.iter()
405-
.zip_eq(arrow_struct_fields.iter().map(|field| field.data_type()))
405+
.zip_eq(arrow_struct_fields.iter())
406406
.zip_eq(iceberg_type.fields().iter())
407407
{
408-
if array.is_nullable() == iceberg_field.required {
408+
let arrow_type = arrow_field.data_type();
409+
if arrow_field.is_nullable() == iceberg_field.required {
409410
return Err(Error::new(
410411
ErrorKind::DataInvalid,
411412
"The nullable field of arrow struct array is not compatitable with iceberg type",
@@ -552,7 +553,7 @@ fn visit_arrow_struct_array_from_field_id<V: ArrowArrayVistor>(
552553
};
553554
let array = array.column(idx);
554555
let arrow_type = field.data_type();
555-
if array.is_nullable() == iceberg_field.required {
556+
if field.is_nullable() == iceberg_field.required {
556557
return Err(Error::new(
557558
ErrorKind::DataInvalid,
558559
"The nullable field of arrow struct array is not compatitable with iceberg type",

0 commit comments

Comments
 (0)