bkietz commented on a change in pull request #11579:
URL: https://github.com/apache/arrow/pull/11579#discussion_r745807991
##########
File path: cpp/src/arrow/compute/exec/hash_join_node.cc
##########
@@ -300,30 +395,36 @@ class HashJoinNode : public ExecNode {
const auto& join_options = checked_cast<const
HashJoinNodeOptions&>(options);
+ const auto& left_schema = *(inputs[0]->output_schema());
+ const auto& right_schema = *(inputs[1]->output_schema());
// This will also validate input schemas
if (join_options.output_all) {
RETURN_NOT_OK(schema_mgr->Init(
- join_options.join_type, *(inputs[0]->output_schema()),
join_options.left_keys,
- *(inputs[1]->output_schema()), join_options.right_keys,
+ join_options.join_type, left_schema, join_options.left_keys,
right_schema,
+ join_options.right_keys, join_options.filter,
join_options.output_prefix_for_left,
join_options.output_prefix_for_right));
} else {
RETURN_NOT_OK(schema_mgr->Init(
- join_options.join_type, *(inputs[0]->output_schema()),
join_options.left_keys,
- join_options.left_output, *(inputs[1]->output_schema()),
- join_options.right_keys, join_options.right_output,
+ join_options.join_type, left_schema, join_options.left_keys,
+ join_options.left_output, right_schema, join_options.right_keys,
+ join_options.right_output, join_options.filter,
join_options.output_prefix_for_left,
join_options.output_prefix_for_right));
}
+ ARROW_ASSIGN_OR_RAISE(Expression filter,
+
schema_mgr->BindFilter(std::move(join_options.filter),
+ left_schema, right_schema));
+
Review comment:
Actually, the move is a no-op here since `join_options` is declared
const& so it can't be moved from. I'd recommend removing the call to move for
clarity
```diff
ARROW_ASSIGN_OR_RAISE(Expression filter,
-
schema_mgr->BindFilter(std::move(join_options.filter),
+ schema_mgr->BindFilter(join_options.filter,
left_schema,
right_schema));
```
--
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]