Fix Redundant ScalarValue Boxed Collection#2523
Conversation
alamb
left a comment
There was a problem hiding this comment.
tustvold
left a comment
There was a problem hiding this comment.
I think this PR removes a non-redundant Box<DataType>. Is it possible this is the cause of the size change?
| /// list of nested ScalarValue (boxed to reduce size_of(ScalarValue)) | ||
| #[allow(clippy::box_collection)] | ||
| List(Option<Box<Vec<ScalarValue>>>, Box<DataType>), | ||
| List(Option<Vec<ScalarValue>>, DataType), |
There was a problem hiding this comment.
I'm not sure about unboxing DataType here
|
So I got this to not change the size by making @alamb What do you think about |
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
It seems fine to me |
|
so we going with changes below? |
|
If you prefer |
|
@tustvold I added boxing back. as its more consistent, you are right. If you feel we should go to Box<[Field]> let me know |
| for c in 0..columns.len() { | ||
| let column = columns.get_mut(c).unwrap(); | ||
| column.push(values[c].clone()); | ||
| for (i, v) in |
There was a problem hiding this comment.
👍 this is a nicer implementation
There was a problem hiding this comment.
clippy complained onfor c in 0..columns.len() :)
There was a problem hiding this comment.
All the better that removing a layer of Boxing lets clippy fix things more easily 👍
There was a problem hiding this comment.
A perhaps more idiomatic way to write this would be something like
for (column, value) in columns.iter_mut().zip(values)
There was a problem hiding this comment.
Yes, thats more concise. Fixed in 2 places.
|
I'll wait until tomorrow to see if @tustvold has any more comments, and if not I'll merge it in |
tustvold
left a comment
There was a problem hiding this comment.
Other than a minor nit and a questionable test change, this looks good to me 👍
Thank you, and apologies for the back and forth
| for c in 0..columns.len() { | ||
| let column = columns.get_mut(c).unwrap(); | ||
| column.push(values[c].clone()); | ||
| for (i, v) in |
There was a problem hiding this comment.
A perhaps more idiomatic way to write this would be something like
for (column, value) in columns.iter_mut().zip(values)
| Some(Box::new(vec![Int64(Some(1)), Int64(Some(5))])), | ||
| Box::new(DataType::Int64), | ||
| Some(vec![Int64(Some(1)), Int64(Some(5))]), | ||
| Box::new(DataType::Int32), |
There was a problem hiding this comment.
fixed. Thanks for finding that

Which issue does this PR close?
Closes #2449.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?