-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to generate a fixed-size-list with nullable fields and specified field name for inner types with FixedSizeListBuilder
#1353
Comments
FixedSizeListBuilder
Thanks for the report @TimDiekmann ! Feel free to submit a PR if you want, and otherwise I think this would be a good first project for someone who wanted to get introduced to the codebase |
i think add a |
@jaredzhou I am not quite sure what you are proposing with |
sorry for not being clear,what i mean is add a create method and pass the pub fn with_field(values_builder: T, length: i32, field: Field) -> Self then we can set |
@jaredzhou seems like a reasonable suggestion to me, though I am not most knoweldgeable person in this area of the code -- feel free to put up a draft PR and we can get some additional eyes on it. Thank you for your contribution! |
thank u @alamb |
I think in the meantime there was a change that it is actually checked. For example, I want to construct this schema: let flow_field = Field::new("flow", DataType::Float32, false);
let field_value_list = Field::new("Value", DataType::FixedSizeList(Arc::from(flow_field), 3), false);
let schema = Schema::new(vec![field_value_list]); So far, no problem. let mut flow_data = FixedSizeListBuilder::new(Float32Builder::new(), 3); The problem is now, when I want to construct a let flow_column = Arc::new(flow_data.finish()) as Arc<dyn Array>;
RecordBatch::try_new(Arc::from(schema), vec![flow_column])? I get the following error:
Am I mistaken here or shouldn't that work? |
I could "fix" th issue by using: let flow_field = Field::new("item", DataType::Float32, true); But that does not seem to be a very good fix though, because my Fields should be not nullable... |
@alamb I created draft PR for this, can you check if it covers this problem? |
Thanks @istvan-fodor -- I will try and review it over the next few days |
Given the same example as in #1352, it's not possible to specify the
Field
of the nested type.I expect to have a
Field
definition likeNotable things:
inner_field
is not nullableinner_field
is called"part"
When using the
FixedSizeListBuilder
, thefinish()
method will generate theField
hardcoded:Proposed solution
Add a way to specify the inner field
The text was updated successfully, but these errors were encountered: