[Feature] Speed up range-based reading of DataSplit data in AI training scenarios
- Dominant language
- Java
- Stars
- 3.4k
- Forks
- 1.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 396
Description
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
### Motivation
For AI training scenarios, it is necessary to read all data from a sample table in either append or DE format for training. The training process reads data sequentially in batches according to the training layer's batch size. If an original Parquet file contains many rows, each batch only reads a specific range of rows within it. Under the current interface, users can only skip unwanted rows one by one, which is a significant waste.
### Solution
We can utilize the Parquet footer information to directly filter out unnecessary page data. Therefore, we propose adding a new method to the `TableRead` interface:
`RecordReader createReader(Split split, RowRange rowRange) throws IOException;`
Here, `RowRange` describes the row range for this split, e.g., [300, 500], allowing Paimon to accelerate the read process based on the underlying data format. If the underlying storage cannot support this optimization (e.g., primary key tables), it should fall back to the original naive implementation that skips rows based on row numbers.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the TableRead interface and its existing createReader implementation, then trace Split, RecordReader, and row-skipping behavior for append and DE data. Review how Parquet footer information is accessed and how primary-key tables read ranges. Done means the new RowRange API accelerates supported formats and preserves the original row-number fallback where it is unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100