dvic opened a new issue, #5330:
URL: https://github.com/apache/arrow-rs/issues/5330
**Describe the bug**
When I try to write a `non-null List<non-null i32>` to a parquet file, I get
an error. Might be related to #385.
**To Reproduce**
```rust
use std::{error::Error, fs::File, sync::Arc};
use ::arrow::record_batch::RecordBatch;
use arrow::{
array::{Int32Builder, ListBuilder},
datatypes::{DataType, Field, Schema},
};
use parquet::arrow::arrow_writer::ArrowWriter;
pub fn main() -> Result<(), Box<dyn Error>> {
let mut builder = ListBuilder::new(Int32Builder::new());
builder.append_value([Some(1), Some(2), Some(3)]);
let array = builder.finish();
let inner_nullable = false;
let schema = Arc::new(Schema::new(vec![Field::new_list(
"col_a",
Field::new_list_field(DataType::Int32, inner_nullable),
false,
)]));
let batch = RecordBatch::try_new(schema, vec![Arc::new(array)])?;
let buf = File::create("test.parquet")?;
let mut writer = ArrowWriter::try_new(buf, batch.schema(), None)?;
writer.write(&batch)?;
writer.close()?;
Ok(())
}
```
**Expected behavior**
I expect no errors, but instead I get:
```
Error: InvalidArgumentError("column types must match schema types,
expected
List(Field { name: \"item\", data_type: Int32, nullable: false, dict_id: 0,
dict_is_ordered: false, metadata: {} })
but found
List(Field { name: \"item\", data_type: Int32, nullable: true, dict_id: 0,
dict_is_ordered: false, metadata: {} })
at column index 0")
```
--
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]