You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,I'm new to Rust and I really like the Rust language and the project. This is what came to mind when I read the code for this project.
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The existed method GenericListArray::from_iter_primitive can only create Array of List<T>,it can't create Array of List<List<T>>and other more nested List.
Describe the solution you'd like
Is possible to implement GenericListArray::from_iter so we can create GenericListArray like this:
// create ListArray [[[1,2],null],[[3]]]let data = vec![Some(vec![Some(vec![Some(1),Some(2)]),None]),Some(vec![Some(vec![Some(3)])]),];let list_array = GenericListArray::<i32>::from_iter::<Int32Type,..?>(data);
Describe alternatives you've considered
Is there a way to support arbitrary nesting depth of list handlers via generic implementation?
I'm curious if Rust's metaprogramming is powerful enough to implement this feature.
I suspect FromIterator will run into issues with trait specialization, we run into this also with supporting both optional and non-optional iterators, but I can't say I've tried to make this work.
That being said you can write something like this, which may be sufficient for your needs. The reason this works is you "help" the compiler by fully specifying the nested type in the form of the builder.
let mut builder = ListBuilder::new(ListBuilder::new(Int32Builder::new()));
builder.extend(vec![
Some(vec![Some(vec![Some(1), None, Some(2)]), None]),
Some(vec![]),
Some(vec![None]),
None,
]);
let built = builder.finish();
Hi,I'm new to Rust and I really like the Rust language and the project. This is what came to mind when I read the code for this project.
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The existed method
GenericListArray::from_iter_primitive
can only create Array ofList<T>
,it can't create Array ofList<List<T>>
and other more nested List.Describe the solution you'd like
Is possible to implement GenericListArray::from_iter so we can create GenericListArray like this:
Describe alternatives you've considered
Is there a way to support arbitrary nesting depth of list handlers via generic implementation?
I'm curious if Rust's metaprogramming is powerful enough to implement this feature.
Additional context
https://docs.rs/arrow-array/32.0.0/arrow_array/array/struct.GenericListArray.html#method.from_iter_primitive
The text was updated successfully, but these errors were encountered: