Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of right join #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

viirya
Copy link

@viirya viirya commented Sep 8, 2015

It will be more convenient to have the support of right join.

@ankurdave
Copy link
Member

Thanks! It's a good idea to support right outer joins. Could they be implemented in terms of left outer joins instead of as a separate primitive? Something like this:

def rightJoin[V2, V3](other: RDD[(K, V2)])(f: (K, Option[V], V2)) => V3): IndexedRDD[K, V3] =
  other.join(this) { (id, a, bOpt) => f(id, bOpt, a) }

@viirya
Copy link
Author

viirya commented Sep 9, 2015

Thanks for reviewing! I've updated this patch. The rightJoin in IndexedRDDPartition has been modified to use left joins. However, for another rightJoin that accepts other: Iterator[(K, V2)], because we can't also do other.leftJoin(this) here, I leave its implementation to PARTPartition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants