Closed Jeadie closed 7 months ago
ListArray
UTF8
let mut stmt = db.prepare(format!(r#"CREATE TABLE "{name}" AS SELECT * FROM arrow(?, ?);"#).as_str()).unwrap(); // [["foo", "baz"], ["bar", "foo"], ["baz"]] let list_array: ArrayRef = Arc::new(ListArray::new( Arc::new(Field::new("item", DataType::Utf8, true)), OffsetBuffer::new(ScalarBuffer::from(vec![0, 2, 4, 5])), Arc::new(StringArray::from(vec![Some("foo"), Some("baz"), Some("bar"), Some("foo"), Some("baz")])), None) ); let b: Result<RecordBatch, arrow::error::ArrowError> = RecordBatch::try_from_iter(vec![("my_col", list_array)]); stmt.execute(arrow_recordbatch_to_query_params( RecordBatch::try_from_iter(vec![("col_name", list_array)])?) );
Can you add a test please?
Will do
Changes
ListArray
with nestedUTF8
typeIllustrative Example