Skip to content

Added an accessor for integer64#7724

Open
brycepanza wants to merge 2 commits intoRdatatable:masterfrom
lacyhamilton:issue7618_integer64
Open

Added an accessor for integer64#7724
brycepanza wants to merge 2 commits intoRdatatable:masterfrom
lacyhamilton:issue7618_integer64

Conversation

@brycepanza
Copy link
Copy Markdown

Closes #7618

Previously, the integer64 type was used using direct casts that lead to inconsistency, such as:

(const int64_t *)DATAPTR_RO(x) and (int64_t *)DATAPTR(x) or
(const int64_t *)REAL(x) and (int64_t *)REAL(x)

This was due to R not natively supporting 64-bit integer type, requiring its definition in the {bit64} pacakge. The direct casting leads to styling differences.

To fix this, we added an accessor for integer64 type in the src/data.table.h .

Now the datatype is accessible using INTEGER64_RO / INTEGER64 to cast to cast from the REAL_RO and REAL accessors.
We also submitted this in the {bit64} repository for future implementation, they will be looking into this after their next release #312.

Also, per this comment on our original issue we did not include new tests to inst/tests/test.Rraw, as our PR adds no new logic, as well as updated the NEWS.md file.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.04%. Comparing base (3a45206) to head (7e83f6e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7724   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files          87       87           
  Lines       17123    17040   -83     
=======================================
- Hits        16959    16877   -82     
+ Misses        164      163    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ben-schwen
Copy link
Copy Markdown
Member

I guess there might have been some misunderstanding here.

Adding the definition from #7618 is not what the issue is about, but instead it should be about carefully iterating over every use of REAL(x) and REAL_RO(x) for integer64

@brycepanza
Copy link
Copy Markdown
Author

@ben-schwen For clarification, this issue also requires replacing uses of REAL/_RO, DATAPTR/_RO, and direct casts on integer64 within the src directory as well to apply the accessor from this issue, or am I still misunderstanding? Thanks for the help!

@ben-schwen
Copy link
Copy Markdown
Member

@ben-schwen For clarification, this issue also requires replacing uses of REAL/_RO, DATAPTR/_RO, and direct casts on integer64 within the src directory as well to apply the accessor from this issue, or am I still misunderstanding? Thanks for the help!

Exactly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we add an accessor for integer64?

2 participants