rluvaton commented on code in PR #7166:
URL: https://github.com/apache/arrow-rs/pull/7166#discussion_r1983241347


##########
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:
   So I kept the HashSet but just for tracking unique values, and now the error 
message have the data type in the order of the input which is deterministic and 
better so people can get a sense about where the input exists



-- 
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-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to