diff --git a/src/vtab/arrow.rs b/src/vtab/arrow.rs index eaefaa79..b5835cbe 100644 --- a/src/vtab/arrow.rs +++ b/src/vtab/arrow.rs @@ -669,7 +669,7 @@ mod test { db.register_table_function::("arrow")?; // Roundtrip a record batch from Rust to DuckDB and back to Rust - let schema = Schema::new(vec![Field::new("a", input_array.data_type().clone(), false)]); + let schema = Schema::new(vec![Field::new("a", input_array.data_type().clone(), true)]); let rb = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(input_array.clone())])?; let param = arrow_recordbatch_to_query_params(rb); @@ -760,6 +760,22 @@ mod test { Ok(()) } + #[test] + fn test_primitive_roundtrip_contains_nulls() -> Result<(), Box> { + let mut builder = arrow::array::PrimitiveBuilder::::new(); + builder.append_value(1); + builder.append_null(); + builder.append_value(3); + builder.append_null(); + builder.append_null(); + builder.append_value(6); + let array = builder.finish(); + + check_rust_primitive_array_roundtrip(array.clone(), array)?; + + Ok(()) + } + #[test] fn test_timestamp_roundtrip() -> Result<(), Box> { check_rust_primitive_array_roundtrip(Int32Array::from(vec![1, 2, 3]), Int32Array::from(vec![1, 2, 3]))?;