2
> str(t2)
Classes ‘data.table’ and 'data.frame':  15349956 obs. of  2 variables:
 $ id      :Class 'integer64'  num [1:15349956] 4.26e-319 4.26e-319 4.26e-319 4.26e-319 4.26e-319 ...
     $ category: int  706 706 706 706 706 706 706 706 706 706 ...
     - attr(*, ".internal.selfref")=<externalptr> 
     - attr(*, "sorted")= chr  "id" "category"

> dput(head(t2))
structure(list(id = structure(c(4.26111856912241e-319, 4.26111856912241e-319, 
4.26111856912241e-319, 4.26111856912241e-319, 4.26111856912241e-319, 
4.26111856912241e-319), class = "integer64"), category = c(706L, 
706L, 706L, 706L, 706L, 706L)), .Names = c("id", "category"), sorted = c("id", 
"category"), class = c("data.table", "data.frame"), row.names = c(NA, 
-6L))


   > head(t2)

      id category
1: 86246      706
2: 86246      706
3: 86246      706

4: 86246      706
5: 86246      706
6: 86246      706

> t2[J(86246,706), nomatch=0]
Empty data.table (0 rows) of 2 cols: id,category

Why is the binary search not finding the rows that we see in t2 head ?

3
  • 1
    Looks like integer64 is not supported as part of a key. Commented May 9, 2014 at 12:54
  • Thank you. That seems to be the problem. Commented May 9, 2014 at 13:22
  • @Arun How do I install the version 1.9.3 ? I keep getting 1.9.2. Commented May 9, 2014 at 13:44

1 Answer 1

2

This is now implemented in v1.9.3 (available from R-Forge), see NEWS :

o bit64::integer64 now works in grouping and joins, #5369. Thanks to James Sams for highlighting UPCs and Clayton Stanley.
Reminder: fread() has been able to detect and read integer64 for a while.

On OP's example above:

t2[J(as.integer64(86246),706), nomatch=0L]
#       id category
# 1: 86246      706
# 2: 86246      706
# 3: 86246      706
# 4: 86246      706
# 5: 86246      706
# 6: 86246      706
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.