Repository navigation
in fread integer64 argument is ignored if int64 type-bump occurs out-of-sample #2749
Description
Activity
Just came across this in fixing #3683. See test
899.1withinteger64 = 'character'11 remaining items
The workaround #2607 (comment) could be implemented quite easily in https://github.com/Rdatatable/data.table/blob/master/R/fread.R, as long as the bug isn't fixed (possible fix described here: #2607 (comment)). If not, at least the documentation of
freadhttps://github.com/Rdatatable/data.table/blob/master/man/fread.Rd should be adjusted and mention it. Should I send a pull request?@petres yes please, also please link this issue. Eventually if issue gets resolved and someone will forget to update documentation then status of the issue can be obtained after following link.
hi. sorry, but does "type-bump occurs out-of-sample" mean, effectively, that the column looked, in the first however-many-rows, like "int", but then, later, oops, (2**32)+1000 showed up? (i'm getting integer64's on a specific column in a file, in spite of
integer64 = "numeric"in my fread call.)almost, not quite. the sample is not the first n rows, but rather 100 equally-spaced blocks of 100 rows. so the non-int row happens to fall outside those regions.
PS you may want to specify colClasses to avoid the type bump warning.
thanks, @MichaelChirico. yes, i already specify colClasses. (my code was failing later, i guess tripping over the integer64 column, not having bit64.)
This issue comes from the use of the
typebumplabel instead ofuserOverridefunction.The object that holds the replacement type for i64 is
readInt64As(declared as static) is inaccessible from within the type bump code path.To clarify, the integer64 type remapping occurs in the
userOverridefunction, which only gets called once, and doesn't get recalled during a type bump.In addition, the
readInt64Asvariable isn't accessible fromfread.c, which is where the type bump system is implemented.- added a commit that references this issue
on May 28, 2025 - added a commit that references this issue
on Jun 16, 2025