You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/24 20:27:18 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #3187: Support StructArray in DynComparator

tustvold opened a new pull request, #3187:
URL: https://github.com/apache/arrow-rs/pull/3187

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Part of #3159 
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   I want to be able to use this to test the row format support for nested types
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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


[GitHub] [arrow-rs] tustvold closed pull request #3187: Support StructArray in DynComparator

Posted by GitBox <gi...@apache.org>.
tustvold closed pull request #3187: Support StructArray in DynComparator
URL: https://github.com/apache/arrow-rs/pull/3187


-- 
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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3187: Support StructArray in DynComparator

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3187:
URL: https://github.com/apache/arrow-rs/pull/3187#discussion_r1031807817


##########
arrow/src/array/ord.rs:
##########
@@ -303,6 +303,26 @@ pub fn build_compare(left: &dyn Array, right: &dyn Array) -> Result<DynComparato
 
             Box::new(move |i, j| left.value(i).cmp(right.value(j)))
         }
+        (Struct(f), Struct(_)) => {
+            let left = as_struct_array(left);
+            let right = as_struct_array(right);
+
+            let comparators = (0..f.len())
+                .map(|idx| {
+                    build_compare(left.column(idx).as_ref(), right.column(idx).as_ref())
+                })
+                .collect::<Result<Vec<_>>>()?;
+
+            Box::new(move |i, j| {
+                for c in &comparators {
+                    match c(i, j) {

Review Comment:
   The performance will not be spectacular, but as mentioned on #3185 performant comparisons should be performed using the row format - this is mainly for completeness



-- 
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


[GitHub] [arrow-rs] tustvold commented on pull request #3187: Support StructArray in DynComparator

Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #3187:
URL: https://github.com/apache/arrow-rs/pull/3187#issuecomment-1327377416

   This doesn't handle nested nulls correctly...


-- 
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