You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pepijnve (via GitHub)" <gi...@apache.org> on 2026/06/26 20:44:46 UTC
[PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
pepijnve opened a new pull request, #10222:
URL: https://github.com/apache/arrow-rs/pull/10222
# Which issue does this PR close?
None; relates to https://github.com/apache/datafusion/pull/23211
# Rationale for this change
`concat_elements_fixed_size_binary` supports concatenation of `FixedSizeBinary(n)` and `FixedSizeBinary(m)`, but the guard clause in `concat_elements_dyn` prevents this from actually being possible with `dyn Array`.
# What changes are included in this PR?
Adjust the guard clause in `concat_elements_dyn` to allow concatenation of mixed `FixedSizeBinary` types.
# Are these changes tested?
- Added an extra test case for mixed `FixedSizeBinary` specifically
- Adjusted the existing unit tests to use `concat_elements_dyn`. This maintains coverage of the functions that were being called (since they're still called indirectly) while increasing the coverage `concat_elements_dyn`
# Are there any user-facing changes?
Yes, the pre conditions of the function are relaxed. This should not be a breaking change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
Posted by "pepijnve (via GitHub)" <gi...@apache.org>.
pepijnve commented on code in PR #10222:
URL: https://github.com/apache/arrow-rs/pull/10222#discussion_r3485599883
##########
arrow-string/src/concat_elements.rs:
##########
@@ -802,9 +869,12 @@ mod tests {
let left = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
let right = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
- let output = concat_elements_binary_view_array(&left, &right).unwrap();
+ let output = concat_elements_dyn(&left, &right).unwrap();
let expected = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
- assert_eq!(output, expected);
+ assert_eq!(
+ output.as_any().downcast_ref::<BinaryViewArray>().unwrap(),
+ &expected
+ );
Review Comment:
Yes, that's much better. I've cleaned up all the tests that were still using more verbose patterns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #10222:
URL: https://github.com/apache/arrow-rs/pull/10222#issuecomment-4822112094
thanks @pepijnve
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #10222:
URL: https://github.com/apache/arrow-rs/pull/10222
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #10222:
URL: https://github.com/apache/arrow-rs/pull/10222#discussion_r3484968070
##########
arrow-string/src/concat_elements.rs:
##########
@@ -571,7 +587,10 @@ mod tests {
let expected = [None, Some("bazfar")].into_iter().collect::<StringArray>();
- assert_eq!(output, expected);
+ assert_eq!(
+ output.as_any().downcast_ref::<StringArray>().unwrap(),
+ &expected
+ );
Review Comment:
```suggestion
assert_eq!(output.as_string::<i32>(), &expected);
```
similarly etc.
##########
arrow-string/src/concat_elements.rs:
##########
@@ -802,9 +869,12 @@ mod tests {
let left = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
let right = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
- let output = concat_elements_binary_view_array(&left, &right).unwrap();
+ let output = concat_elements_dyn(&left, &right).unwrap();
let expected = BinaryViewArray::from_iter(vec![] as Vec<Option<&[u8]>>);
- assert_eq!(output, expected);
+ assert_eq!(
+ output.as_any().downcast_ref::<BinaryViewArray>().unwrap(),
+ &expected
+ );
Review Comment:
```suggestion
assert_eq!(output.as_binary_view(), &expected);
```
with `use arrow_array::cast::AsArray`
##########
arrow-string/src/concat_elements.rs:
##########
@@ -406,55 +406,59 @@ pub fn concat_elements_string_view_array(
///
/// This function errors if the arrays are of different types.
Review Comment:
I wonder if we need to slightly update this docstring 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support concatenation of mixed FixedSizeBinary via `concat_elements_dyn` [arrow-rs]
Posted by "pepijnve (via GitHub)" <gi...@apache.org>.
pepijnve commented on code in PR #10222:
URL: https://github.com/apache/arrow-rs/pull/10222#discussion_r3485600726
##########
arrow-string/src/concat_elements.rs:
##########
@@ -406,55 +406,59 @@ pub fn concat_elements_string_view_array(
///
/// This function errors if the arrays are of different types.
Review Comment:
I added some extra text to make the FixedSizeBinary support explicit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org