@@ -21840,27 +21840,23 @@ test(2343.2, forderv(list(x)), integer(0))
2184021840
2184121841# Keep key when new column added before existing key in j
2184221842# Incorrect key can lead to incorrect join result #7364
21843- local({
21844- DT = data.table(V1 = 1:2, key = "V1")
21845- test(2344.00, key(DT[, .(V2 = c("b", "a"), V1)]), "V1")
21846- test(2344.01, key(DT[, .(V2 = -V1, V1)]), "V1")
21847-
21848- d1 = data.table(
21849- V1 = c(1L, 0L, 1L),
21850- V2 = c("a", "a", "b"),
21851- key = "V2"
21852- )
21853-
21854- d2 = d1[, .(
21855- V1,
21856- label = c("one", "zero", "one"),
21857- V2
21858- )]
21859-
21860- r = d2[
21861- data.table(label = "one"),
21862- on = "label",
21863- allow.cartesian = TRUE
21864- ]
21865- test(2344.02, nrow(r), 2L)
21866- })
21843+ DT = data.table(V1 = 1:2, key = "V1")
21844+ test(2344.00, key(DT[, .(V2 = c("b", "a"), V1)]), "V1")
21845+ test(2344.01, key(DT[, .(V2 = -V1, V1)]), "V1")
21846+
21847+ d1 = data.table(
21848+ V1 = c(1L, 0L, 1L),
21849+ V2 = c("a", "a", "b"),
21850+ key = "V2"
21851+ )
21852+ d2 = d1[, .(
21853+ V1,
21854+ label = c("one", "zero", "one"),
21855+ V2
21856+ )]
21857+ r = d2[
21858+ data.table(label = "one"),
21859+ on = "label",
21860+ allow.cartesian = TRUE
21861+ ]
21862+ test(2344.02, nrow(r), 2L)
0 commit comments