Skip to content

Commit 6b082fb

Browse files
committed
fix #7364: use jvnames instead of jnames in get_shared_keys
1 parent 4b53e30 commit 6b082fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# data.table news and updates
2+
## BUG FIXES
3+
4+
1. Cartesian joins with `allow.cartesian=TRUE` after transformations using `[.data.table` would return fewer rows than expected due to incorrect `sorted` attribute being set. The issue occurred when `get_shared_keys()` used `jnames` instead of `jvnames` for index calculation, [#7364](https://github.com/Rdatatable/data.table/issues/7364). Thanks to @czeildi for reporting, @aitap for analysis, and @ANAMASGARD for fixing.
5+
26

37
**If you are viewing this file on CRAN, please check [latest news on GitHub](https://github.com/Rdatatable/data.table/blob/master/NEWS.md) where the formatting is also better.**
48

R/data.table.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ replace_dot_alias = function(e) {
14491449
jvnames = jnames = sdvars
14501450
else
14511451
jnames = as.character(Filter(is.name, jsub)[-1L])
1452-
key_idx = chmatch(key, jnames)
1452+
key_idx = chmatch(key, jvnames)
14531453
missing_keys = which(is.na(key_idx))
14541454
if (length(missing_keys) && missing_keys[1L] == 1L) return(NULL)
14551455
if (!length(missing_keys)) return(jvnames[key_idx])

0 commit comments

Comments
 (0)