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
The gist of the issue is that when attempting to cast a character column to integer via colClasses, fread will error out under some conditions and produce unexpected results in others (instead of quietly returning the uncasted column). Main examples were all run on 1.11.8. Code was originally found to work on 1.10.4 and is labeled as the expected result.
Not sure if each of these belong as separate issues, since they seem to be somewhat related. If these deserve separate issues please let me know and I'll be happy to create them.
#Minimal reproducible examples [1.11.8] Segfault is created when casting character column to integer when the character column should be returned:
*** caught segfault ***
address 0x14576766a, cause 'memory not mapped'
Traceback:
1: data.table::fread("~/test_dt.csv", colClasses = c(b = "integer"))
[1.10.4] Expected result (a is numeric, b is character):
a b
1: 1.0 1
2: 2.0 2
3: 3.0 E
4: 4.0 4
5: 5.1 5
[1.11.8] When decimals can be cast to integers, no segfault occurs, but the character values of the cast column are all the same. In this case, a is read in as integer, b as character:
[1.11.8] And lastly, if I additionally cast the integer column back to numeric via colClasses, the resulting column contains mostly empty strings. In this case, a is numeric, b is character:
This was just fixed in v1.12.0 now on CRAN but I omitted to link this issue into that fix. I just ran your tests and confirmed. I'll add them verbatim to the test suite and thank you for reporting in NEWS item 5 for v1.12.0.
The gist of the issue is that when attempting to cast a character column to integer via colClasses, fread will error out under some conditions and produce unexpected results in others (instead of quietly returning the uncasted column). Main examples were all run on
1.11.8
. Code was originally found to work on1.10.4
and is labeled as the expected result.Not sure if each of these belong as separate issues, since they seem to be somewhat related. If these deserve separate issues please let me know and I'll be happy to create them.
#
Minimal reproducible examples
[1.11.8] Segfault is created when casting character column to integer when the character column should be returned:
[1.10.4] Expected result (a is numeric, b is character):
[1.11.8] When decimals can be cast to integers, no segfault occurs, but the character values of the cast column are all the same. In this case, a is read in as integer, b as character:
[1.10.4] Expected result (a is integer, b is character):
[1.11.8] Above is the same behavior as if column a did not exist (column b is output as character):
[1.10.4] Expected result (b is character):
[1.11.8] And lastly, if I additionally cast the integer column back to numeric via colClasses, the resulting column contains mostly empty strings. In this case, a is numeric, b is character:
[1.10.4] Expected result (a is numeric, b is character):
#
Output of sessionInfo()
The text was updated successfully, but these errors were encountered: