fread should not create data.tables with more than 2^31 rows

Open
#7,438 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start with fread's handling of row counts and the fread documentation on field width and size limits. Define the behavior when an import exceeds R's supported row count, then verify that oversized inputs are stopped or limited with a warning and that the documentation explains the constraint.

Written by the indexing model from the issue text.

Description

longvec

I just imported a huge file with more than 2^31 rows using fread on a machine with 512 GB RAM. It worked great. Unfortunately, I couldn't do anything with the resulting data.table. Autoprinting or subsetting returned a "long vectors not supported yet" error, which isn't surprising.

I suggest to stop fread before the data.table gets too large. Maybe it could return (with a warning) as many rows as R supports.

The fread documentation mentions field width limits but I don't see a mention that R has a limit regarding the number of rows.

My solution was to use nrows and skip to import as two data.tables but that was after I wasted time with reading the whole file.

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.