-
Notifications
You must be signed in to change notification settings - Fork 416
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
How to implement Full outer join using MoreLinq? #332
Comments
You can do a full outer join by using var grouped = panelDataWithChange.Values.FullGroupJoin(
scrapingRecords,
panel => new {panel.Domain, panel.RefererFlag, panel.Referer},
scrape => new {scrape.Domain, scrape.RefererFlag, scrape.Referer}
);
var joined = from g in grouped
from panel in g.First.DefaultIfEmpty()
from scrape in g.Second.DefaultIfEmpty()
select new KeywordAnalysisRecord {
Domain = g.Key.Domain,
Referer = g.Key.Referer,
RefererFlag = g.Key.RefererFlag,
Visits = panel?.Visits ?? 0,
Change = panel?.Change,
DestUrl = scrape?.DestUrl ?? "",
Position = scrape?.Position,
PreviousMonthVisits = panel?.PreviousMonthVisits,
SearchEngineFamily = panel?.SearchEngineFamily ?? scrape?.SearchEngineFamily,
}; Note the |
@fsateler Thanks a lot again! |
Also, just as a suggestion, regardless if there's a penalty or not, it would be really nice having a IMHO. |
Wait @fsateler, won't your code using |
Hi,
First, thanks a lot for maintaining this amazingly helpful library!
How can I implement a full outer join two unordered sequences using MoreLinq?
I saw you implemented
FullGroupJoin
but I'm don't want the grouping stuff.I'm looking for something like in this SO answer: https://stackoverflow.com/a/13503860/601179 , but with better implementation (using
yield return
for example)I've tried
OrderedMerge
but had troubles using it as the sequences aren't ordered (as I don't care about the order) and don't implementIComparer
Is there a way of doing that?
Many thanks!
The text was updated successfully, but these errors were encountered: