liukun4515 commented on code in PR #4327:
URL: https://github.com/apache/arrow-datafusion/pull/4327#discussion_r1029931175
##########
datafusion/core/src/physical_plan/joins/hash_join.rs:
##########
@@ -2329,6 +2332,63 @@ mod tests {
Ok(())
}
+ #[tokio::test]
+ async fn join_left_semi_with_filter() -> Result<()> {
+ let session_ctx = SessionContext::new();
+ let task_ctx = session_ctx.task_ctx();
+ let left = build_table(
+ ("a1", &vec![1, 2, 2, 3]),
+ ("b1", &vec![4, 5, 5, 7]), // 7 does not exist on the right
+ ("c1", &vec![7, 8, 8, 9]),
+ );
+ let right = build_table(
+ ("a2", &vec![10, 20, 30, 40]),
+ ("b1", &vec![4, 5, 6, 5]), // 5 is double on the right
+ ("c2", &vec![70, 80, 90, 100]),
+ );
+ let on = vec![(
+ Column::new_with_schema("b1", &left.schema())?,
+ Column::new_with_schema("b1", &right.schema())?,
+ )];
+
+ // build filter right.b2 > 4
Review Comment:
> Ah, the key is this filter. 👍
Yes, we can add `filter` to filter left row or right row, and get the new
result.
--
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]