NVIDIA-NeMo / NVIDIA-NeMo/Curator
split_large_files: RecursionError when a single parquet row exceeds the target size
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 328
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 30
Description
Description
split_large_files.py's _split_table recurses forever (ends in RecursionError) when a parquet chunk contains a single row that is itself larger than the target size. There is no base case for num_rows <= 1, so the bisection keeps slicing the same 1-row table in half (1 // 2 = 0) forever.
This is realistic for interleaved-document parquet files with large embedded payloads (e.g. base64 images) — one 3 MB row with --target-size-mb 1 kills the tool.
Steps to reproduce
import pyarrow as pa
from nemo_curator.utils.split_large_files import _split_table
t = pa.table({"text": ["x" * 3_000_000]})
list(_split_table(t, 1024 * 1024))
# RecursionError
Expected behavior
A row that can't be split further becomes its own shard (same behavior the JSONL splitter documents for oversized single records — write it alone, ideally with a warning), and the tool finishes.
Actual behavior
_split_table slices [0 : n//2] and [n//2 : n]; for n=1 both slices are 1-row/0-row tables that never get smaller → infinite recursion.
Environment
nemo-curator main (93b48525), Python 3.12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in split_large_files.py at the _split_table entry point and run the provided pyarrow reproduction with a single 3 MB row and a 1 MB target. Ensure a row that cannot be split further is emitted as its own shard rather than recursing, and verify the reproduction completes without RecursionError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100