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

Bizarre behavior of by=.EACHI + update join (:=) #6298

Open
MichaelChirico opened this issue Jul 17, 2024 · 2 comments
Open

Bizarre behavior of by=.EACHI + update join (:=) #6298

MichaelChirico opened this issue Jul 17, 2024 · 2 comments
Labels

Comments

@MichaelChirico
Copy link
Member

Looks like a bug to me -- can't see how to justify min/max being the same, nor how all could possibly be just 4 for both.

DT1 = data.table(a = 1:2)
DT2 = data.table(a = c(1, 1, 2, 2), b = 1:4)
DT1[DT2, on='a', `:=`(min = min(b), max = max(b), all = list(b)), by = .EACHI]
DT1[]
#        a   min   max    all
#    <int> <int> <int> <list>
# 1:     1     2     2      4
# 2:     2     4     4      4

I might have expected:

DT1[]
#        a   min   max    all
#    <int> <int> <int> <list>
# 1:     1     1     2    1,2
# 2:     2     3     4    3,4

Possibly related: #4996

@tdhock
Copy link
Member

tdhock commented Jul 18, 2024

this seems related to inconsistent naming of columns in result of non-equi join #3437 #4949 (comment)
There is a proposed solution #3093 which I think would be great to work on for a new release. (not sure if it would solve this by=.EACHI + update issue though)

@tdhock
Copy link
Member

tdhock commented Jul 18, 2024

could be related to not finding variables in rolling join with by=.EACHI ? #5564

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

No branches or pull requests

2 participants