tustvold commented on code in PR #7166:
URL: https://github.com/apache/arrow-rs/pull/7166#discussion_r1968118413
##########
arrow-select/src/concat.rs:
##########
@@ -223,8 +223,29 @@ pub fn concat(arrays: &[&dyn Array]) -> Result<ArrayRef,
ArrowError> {
let d = arrays[0].data_type();
if arrays.iter().skip(1).any(|array| array.data_type() != d) {
+ // Get all the unique data types
+ let input_data_types = {
+ let unique = arrays
+ .iter()
+ .map(|array| array.data_type())
+ .collect::<HashSet<&DataType>>();
+
+ // Allow unused mut as we need it for tests
+ #[allow(unused_mut)]
+ let mut names = unique
+ .into_iter()
+ .map(|dt| format!("{dt}"))
+ .collect::<Vec<_>>();
+
+ // Only sort in tests to make the error message is deterministic
Review Comment:
Perhaps we could just use a BTreeSet? It will be slightly slower, but having
non-deterministic error messages I think would be surprising for people.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]