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/03 18:57:46 UTC

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

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


##########
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:
   In addition, the left keys and right keys must have length equal to each other.  E.g. `left_keys.size() == right_keys.size()`
   



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