pitrou commented on code in PR #48272:
URL: https://github.com/apache/arrow/pull/48272#discussion_r2567853445


##########
cpp/src/arrow/acero/hash_join_node.cc:
##########
@@ -370,9 +370,19 @@ Result<Expression> HashJoinSchema::BindFilter(Expression 
filter,
                                               const Schema& left_schema,
                                               const Schema& right_schema,
                                               ExecContext* exec_context) {
-  if (filter.IsBound() || filter == literal(true)) {
+  auto ValidateFilterTypeAndReturn = [](Expression filter) -> 
Result<Expression> {
+    if (filter.type()->id() != Type::BOOL) {
+      return Status::TypeError("Filter expression must evaluate to bool, but ",
+                               filter.ToString(), " evaluates to ",
+                               filter.type()->ToString());
+    }
     return filter;
+  };
+
+  if (filter.IsBound()) {

Review Comment:
   I suppose there's already a unit test for that?



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

Reply via email to