Skip to content

Conversation

@detule
Copy link
Collaborator

@detule detule commented Jan 3, 2026

Closes #955

Tested with:

> library(data.table)
> datetime <- seq(as.POSIXct("2001-01-01"), as.POSIXct("2001-01-03"), by = "5 hour")
> tbl <- data.table(idate = as.IDate(datetime), a = rep(1:2, 5))
> .Internal(inspect(tbl$idate))
@55a4ffa26a38 13 INTSXP g0c4 [OBJ,REF(6),ATT] (len=10, tl=0) 11323,11323,11323,11323,11323,...
ATTRIB:
...<snip>...>
> dbWriteTable(conn, '#intsxp_test', tbl)
> DBI::dbReadTable(conn, '#intsxp_test')
          idate a
  1  2001-01-01 1
  2  2001-01-01 2
  3  2001-01-01 1
  4  2001-01-01 2
  5  2001-01-01 1
  6  2001-01-02 2
  7  2001-01-02 1
  8  2001-01-02 2
  9  2001-01-02 1
  10 2001-01-02 2
>

@detule detule requested a review from simonpcouch January 3, 2026 21:39
Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

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.

Make handling of data.table::IDate more efficient

2 participants