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/05/06 18:23:56 UTC

[GitHub] [arrow] JabariBooker commented on a diff in pull request #13051: ARROW-14185: [C++] HashJoinNode should validate HashJoinNodeOptions

JabariBooker commented on code in PR #13051:
URL: https://github.com/apache/arrow/pull/13051#discussion_r867069250


##########
cpp/src/arrow/compute/exec/hash_join_node.cc:
##########
@@ -453,6 +453,20 @@ Status HashJoinSchema::CollectFilterColumns(std::vector<FieldRef>& left_filter,
   return Status::OK();
 }
 
+Status ValidateHashJoinNodeOptions(const HashJoinNodeOptions& join_options) {
+  if (join_options.key_cmp.size() < 1 || join_options.left_keys.size() < 1 ||
+      join_options.right_keys.size() < 1) {
+    return Status::Invalid("key_cmp and keys cannot be empty");
+  }
+
+  if ((join_options.key_cmp.size() != join_options.left_keys.size()) ||
+      (join_options.key_cmp.size() != join_options.right_keys.size()) {
+    return Status::Invalid("key_cmp and keys must have the same size");
+  }

Review Comment:
   This is implied in the logic of this if statement. If `key_cmp.size() == left_keys.size()` and `key_cmp.size() == right_keys.size()`, then `left_keys.size() == right_keys.size()` must be true as well.



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