[core][common]support row range read of a DataSplit - #9705
weijietong wants to merge 8 commits into
Conversation
|
Why not just use |
|
The critical RowRange use case is slicing the stream after a filter — e.g. "give me the 1000th–2000th matching rows for training." Even composed with a filter, IndexedSplit only ANDs two physical-position bitmaps; it never renumbers rows into a This is exactly what AbstractDataTableRead.outerWrap encodes:
The AI training-shard use case (why RowRange exists) In AI / ML data loading, a common pattern is sharding a dataset by effective sample position:
IndexedSplit cannot express this:
Conclusion IndexedSplit and RowRange are complementary, not interchangeable:
RowRange was introduced precisely to cover IndexedSplit's blind spots — append tables, post-filter effective-row slicing, and merge-output slicing — all validated by tests in this PR (testAppendOrcRowRange..., testRowRangeWithFilterWrapsOutsideFilter, |
JingsongLi
left a comment
There was a problem hiding this comment.
The post-filter/merge-output slicing use case is distinct from IndexedSplit's physical row IDs and has end-to-end value. Two fallback paths currently violate the requested range; both were reproduced using real table writes and reads, and both passed after focused conditional fixes. Details are inline.
The existing Parquet DE range test also passes. The new failures specifically cover ORC column-merge reads and a supported file-format change within an append table.
JingsongLi
left a comment
There was a problem hiding this comment.
The two issues from my previous review are fixed. Data-evolution reads now construct the row-range bitmap only when the underlying reader can apply it, avoiding the ORC double-skip; raw reads check every file format before choosing pushdown, so a Parquet-to-ORC mixed split retains the required fallback. I re-ran both real write/read reproducers against the updated production classes, and 32 distinct focused tests passed across the range utilities, append/raw reads and data-evolution reads. This has concrete value for range-based training reads described in #9668, and I found no remaining actionable regression in the declared full-data DataSplit scope. Validation used isolated JDK 8 compilation and local cached dependencies, not a full Maven build; the visible CI failure in S3FileIOTest is a container-fetch failure outside this diff.
|
Could you clarify the concrete purpose of this PR? Is there an actual production workload that needs this Java range-read API? The AI training motivation alone does not explain the Java-side requirement: PyPaimon's training read path uses its own Python/PyArrow implementation. Please describe the production application, how its training data loader calls the Java reader, and the specific bottleneck this change addresses. If there is no actual production use case for this API, please close this PR. |
|
In our use case, the training framework calculates the total number of rows within a partition based on a snapshot and determines the number of row ranges to be read for each data split. Without this new API, the initial implementation would have relied on the framework obtaining row-by-row iteration via Note: We did not use PyPaimon. |
|
I am not necessarily advocating that this PR must be merged; I simply feel that other training workflows would likely require this same interface and performance optimization. Without this API, our training framework would be forced to implement—in an intrusive manner—custom read logic (handling primary key tables, append-only tables, and DE tables) to process raw files stored on OSS, push down row ranges, and accelerate read speeds; such an approach would lack maintainability and extensibility. However, if you do not consider this a general-purpose requirement, I am happy to close the PR. |
JingsongLi
left a comment
There was a problem hiding this comment.
Reviewed b6b9ae1. Requirement fit: SUPPORTED for the clarified Java training-reader caller. Implementation: FINDINGS.
The latest explanation identifies a Java RecordReader consumer over Parquet training ranges, so efficient bounded reads have a concrete end-to-end use. The earlier ORC double-slicing and mixed-format fallback findings remain fixed. A new supported fallback case still violates the effective-row contract: ignoring a missing file leaves metadata-based offsets counting rows that the reader never emits. The real write/read reproduction is inline.
The head is unchanged from the prior 32 passing focused tests; I verified the relevant production sources match that tested head. A new exact-head missing-file probe fails with [] versus [6,7], and disabling metadata-based pushdown when files may be ignored makes it pass. No training throughput benchmark was rerun, and the current CI rollup remains failing.
|
Although the ORC reader cannot perform page-level row filtering like Parquet to return precise row ranges, it can still ultimately yield precise row ranges through the outermost encapsulation by ApplyBitmapIndexFileRecordIterator. Therefore, the ORC format supports row range pushdown for accelerated reads. |
|
The CI test case seems always fail. The failure is caused by Testcontainers being unable to pull the MinIO image (quay.io/minio/minio:RELEASE.2022-02-07T08-17-33Z), so S3FileIOTest fails before running any assertions. Can you solve it ? @JingsongLi |
Purpose
This is to solve issue.
Tests
tests for pk table,append table, DE table.