seddonm1 commented on a change in pull request #797:
URL: https://github.com/apache/arrow-datafusion/pull/797#discussion_r682104499
##########
File path: datafusion/src/logical_plan/builder.rs
##########
@@ -287,16 +287,125 @@ impl LogicalPlanBuilder {
.into_iter()
.zip(join_keys.1.into_iter())
.map(|(l, r)| {
- let mut swap = false;
let l = l.into();
- let left_key = l.clone().normalize(&self.plan).or_else(|_|
{
- swap = true;
- l.normalize(right)
- });
- if swap {
- (r.into().normalize(&self.plan), left_key)
- } else {
- (left_key, r.into().normalize(right))
+ let r = r.into();
+ let lr = l.relation.clone();
+ let rr = r.relation.clone();
+
+ match (lr, rr) {
+ (Some(lr), Some(rr)) => {
+ let l_is_left =
+ self.plan.all_schemas().iter().any(|schema| {
+ schema.fields().iter().any(|field| {
Review comment:
Agreed. I will see what we can do. I was trying to avoid heavy work for
non-qualified tables but will revisit.
--
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]