-
Notifications
You must be signed in to change notification settings - Fork 842
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
Cleanup cast_primitive_to_list #4511
Conversation
to_type.clone(), | ||
array.len(), | ||
Some(cast_array.null_count()), | ||
cast_array.nulls().map(|b| b.inner().sliced()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason to duplicate the null buffer here, so I opted to just remove this. I can easily revert if people feel it is better to include the child null mask twice
@@ -9448,4 +9420,21 @@ mod tests { | |||
assert_eq!("1969-12-31", string_array.value(1)); | |||
assert_eq!("1989-12-31", string_array.value(2)); | |||
} | |||
|
|||
#[test] | |||
fn test_nested_list() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not new functionality, I just couldn't find a test of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
@@ -5098,7 +5070,7 @@ mod tests { | |||
) | |||
.unwrap(); | |||
assert_eq!(5, b.len()); | |||
assert_eq!(1, b.null_count()); | |||
assert_eq!(0, b.null_count()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the difference that b[1] is [null] (aka a 1 element list with a null) rather than null itself? I believe that is already covered below.
arrow-cast/src/cast.rs
Outdated
fn test_nested_list() { | ||
let mut list = ListBuilder::new(Int32Builder::new()); | ||
list.append_value([Some(1), Some(2), Some(3)]); | ||
list.append_value([Some(4), Some(5), Some(6)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please include a NULL in the list -- for example,
list.append_value([Some(4), Some(5), Some(6)]); | |
list.append_value([Some(4), Null, Some(6)]); |
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?