-
Notifications
You must be signed in to change notification settings - Fork 998
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
Implement joins using secondary keys #1130
Comments
Maybe X[Y, on=col] # default join - currently right outer, from 2.0 inner join(?)
X[Y, on=col+] # right join
X[Y, on=+col] # left join
X[Y, on=+col+] # full outer join I'm sure we can figured out the better, this would finally closes #614 |
! or - for a non-join?
|
Honestly, I think these suggested "on" decorators (i.e. the For your reference, I read Convince me that my intuition should change and provide a new reading for the suggested syntax. |
I see the benefit in that it extends @eantonya 's reading by saying "take the Y rows of X where we define Y as being unique based on columns/attributes A,B,C" (currently that last bit is implied not explicit in basic syntax). Not sure I like the plus operator as a means of specifying behaviour - I'd prefer an explicit I'd also really love to see 1.9.6 on CRAN soon so I can use it in production ASAP - will adding this feature delay significantly? |
For me, the point of this FR is 1) to be able to explicitly specify the columns used for the join, and 2) that the specified columns will automatically use/create secondary keys, if they are not the primary key. To be fully general, the syntax should also 3) allow join columns to be given separately for Being able to specify left, right, full, outer, non-join etc. would be nice, but that is a separate FR (#614) which has not been given priority or milestone yet. I assume the "join" keyword is reserved for that FR. |
Throwing my hat in the ring of support for this, would clean up this process of mine substantially. |
@arunsrinivasan, I just wondering, is the syntax for DT1[DT2, on = list(...) ]
# or
DT1[DT2, on = .(...) ] |
Quite interesting idea, less typing of quotes ( |
All done. @dselivanov good point. |
Nice work, @arunsrinivasan !
copyable code for above output:
Please feel free to copy this where it belongs if you think it's worth it and that this was not the right place. |
X[Y]
gains anon =
argument (as proposed by Matt).merge
will not copy anymore once implemented.Update posts:
The text was updated successfully, but these errors were encountered: