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

CJ sorted setkey but wrong order #1513

Closed
alexdeng opened this issue Feb 2, 2016 · 1 comment
Closed

CJ sorted setkey but wrong order #1513

alexdeng opened this issue Feb 2, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@alexdeng
Copy link

alexdeng commented Feb 2, 2016

This wrong order resulted in CJ (with default sorted = TRUE) is causing bugs in .[i, join

a = CJ(c(1,2,2),c(1,2,3))
a
V1 V2
1: 1 1
2: 1 2
3: 1 3
4: 2 1
5: 2 2
6: 2 3
7: 2 1
8: 2 2
9: 2 3
setkey(a,V1,V2)
Warning message:
In setkeyv(x, cols, verbose = verbose, physical = physical) :
Already keyed by this key but had invalid row order, key rebuilt. If you didn't go under the hood please let datatable-help know so the root cause can be fixed.

@jangorecki
Copy link
Member

Reproducible code:

library(data.table)
a = CJ(c(1,2,2),c(1,2,3))
setkey(a, V1, V2)

@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Feb 2, 2016
@arunsrinivasan arunsrinivasan self-assigned this Feb 8, 2016
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

3 participants