XiaoHongbo-Hope opened a new pull request, #8977:
URL: https://github.com/apache/paimon/pull/8977

   ### Purpose
   
   `TableRead.to_iterator` applies its limit within one iterator. A streaming 
Torch dataset creates multiple iterators across DataLoader workers, 
split-prefetch threads, and shuffled split readers, so each iterator could 
consume the full limit independently. For example, two four-row splits with 
`LIMIT 5` returned eight rows with two DataLoader workers.
   
   This change adds a row quota shared by all worker processes and prefetch 
threads. A reader reserves quota before materializing its next row and returns 
unused reservations when an iterator is exhausted. The quota resets after all 
workers finish an iteration, including with persistent workers. Split 
assignment, worker concurrency, and prefetch concurrency remain enabled.
   
   This bug predates and is independent of #8808, so the fix is submitted 
separately.
   
   ### Tests
   
   - `python3.11 -m pytest -q pypaimon/tests/torch_read_test.py` (19 passed, 2 
subtests passed)
   - `python3.11 -m flake8 --config=dev/cfg.ini 
pypaimon/read/datasource/torch_dataset.py pypaimon/tests/torch_read_test.py`
   - Python 3.6 `py_compile` for the changed Python files
   - `git diff --check`
   
   The regression coverage includes fork and spawn DataLoader workers, 
concurrent split prefetch, persistent-worker iteration reset, and shuffled 
streaming reads.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to