You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set(callersi, j=icol, value=i[[icol]]) # factor in i joining to character in x will return character and not keep x's factor; e.g. for antaresRead #3581
74
77
next
75
78
} elseif (i_merge_type=="character") {
76
79
if (verbose) catf("Matching character column %s to factor levels in %s.\n", iname, xname)
if (x_merge_type=="integer64") { w=i; wc=icol; wclass=i_merge_type; } else { w=x; wc=xcol; wclass=x_merge_type; nm=rev(nm) } # w is which to coerce
106
108
if (wclass=="integer"|| (wclass=="double"&& fitsInInt64(w[[wc]]))) {
107
-
if (verbose) catf("Coercing %s column %s%s to type integer64 to match type of %s.\n", wclass, nm[1L], if (wclass=="double") " (which has integer64 representation, e.g. no fractions)"else"", nm[2L])
108
-
set(w, j=wc, value=bit64::as.integer64(w[[wc]]))
109
+
from_det_msg=if (wclass=="double") gettext(" (which has integer64 representation, e.g. no fractions)")else""
} else stopf("Incompatible join types: %s is type integer64 but %s is type double and cannot be coerced to integer64 (e.g. has fractions)", nm[2L], nm[1L])
test(2044.61, dt1[dt2, ..cols, on="int==realDouble", verbose=TRUE], # this was wrong in v1.12.2 (the fractions were truncated and joined to next lowest int)
output="Coercing integer column i.date to type double for join to match type of x.date")
15627
+
output="Coercing integer column i.date .for join. to type double to match type of x.date")
15628
15628
15629
15629
# complex values in grouping, #3639
15630
15630
set.seed(42)
@@ -20634,8 +20634,9 @@ test(2296, d2[x %no such operator% 1], error = '%no such operator%')
20634
20634
# fix coercing integer/double for joins on multiple columns, #6602
20635
20635
x = data.table(a=1L)
20636
20636
y = data.table(c=1L, d=1)
20637
-
test(2297.01, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a to type double.*Coercing .*c to type double")
20638
-
test(2297.02, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a to type double.*Coercing .*c to type double")
20637
+
# 2297.01 and 02: previous test was "Coercing .*a to type double.*Coercing .*c to type double" in which 2nd ".*" silently captures "for join"
20638
+
test(2297.01, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a (.for join.)? to type double.*Coercing .*c to type double")
20639
+
test(2297.02, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a (.for join.)? to type double.*Coercing .*c to type double")
20639
20640
x = data.table(a=1)
20640
20641
y = data.table(c=1, d=1L)
20641
20642
test(2297.03, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
0 commit comments