mustafasrepo commented on code in PR #8991:
URL: https://github.com/apache/arrow-datafusion/pull/8991#discussion_r1469162694
##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -405,12 +406,47 @@ pub fn check_join_is_valid(left: &Schema, right: &Schema,
on: JoinOnRef) -> Resu
fn check_join_set_is_valid(
left: &HashSet<Column>,
right: &HashSet<Column>,
- on: &[(Column, Column)],
+ on: &[(PhysicalExprRef, PhysicalExprRef)],
) -> Result<()> {
- let on_left = &on.iter().map(|on| on.0.clone()).collect::<HashSet<_>>();
+ let on_left = &on
+ .iter()
+ .flat_map(|on| {
+ let left = on.0.clone();
+
+ let mut columns = vec![];
+ left.apply(&mut |expr| {
+ Ok({
+ if let Some(column) =
expr.as_any().downcast_ref::<Column>() {
+ columns.push(column.clone());
+ }
+ VisitRecursion::Continue
+ })
+ })
+ .unwrap();
+ columns
+ })
+ .collect::<HashSet<_>>();
let left_missing = on_left.difference(left).collect::<HashSet<_>>();
- let on_right = &on.iter().map(|on| on.1.clone()).collect::<HashSet<_>>();
+ let on_right = &on
+ .iter()
+ .flat_map(|on| {
+ let right = on.1.clone();
+
+ let mut columns = vec![];
+ right
+ .apply(&mut |expr| {
+ Ok({
+ if let Some(column) =
expr.as_any().downcast_ref::<Column>() {
+ columns.push(column.clone());
+ }
+ VisitRecursion::Continue
+ })
+ })
+ .unwrap();
+ columns
Review Comment:
Similar to comment above
--
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]