Skip to content

[data] Add orc datasource - #64540

Open
laysfire wants to merge 5 commits into
ray-project:masterfrom
laysfire:add_orcdatasource
Open

[data] Add orc datasource#64540
laysfire wants to merge 5 commits into
ray-project:masterfrom
laysfire:add_orcdatasource

Conversation

@laysfire

@laysfire laysfire commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Support read orc format

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@laysfire
laysfire requested a review from a team as a code owner July 6, 2026 03:31
Comment thread python/ray/data/_internal/datasource_v2/readers/orc_file_reader.py Outdated
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@laysfire

laysfire commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a concrete DataSourceV2 implementation for ORC files (OrcDatasourceV2) with worker-side stripe chunking. It adds OrcFileChunker, OrcFileReader, OrcScanner, OrcInMemorySizeEstimator, and exposes the public read_orc API. Feedback on the implementation suggests optimizing the file reading loop in OrcFileReader by checking if the row limit has already been reached before opening subsequent files, thereby avoiding unnecessary I/O overhead.

Comment on lines +62 to +63
for path, chunk_metadatas in self._iter_contiguous_path_groups(input_split):
for table in self._read_path(path, chunk_metadatas):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid unnecessary file opens and I/O overhead, we should check if the row limit has already been reached before calling _read_path for subsequent files in the outer loop.

Suggested change
for path, chunk_metadatas in self._iter_contiguous_path_groups(input_split):
for table in self._read_path(path, chunk_metadatas):
for path, chunk_metadatas in self._iter_contiguous_path_groups(input_split):
if self._limit is not None and rows_read >= self._limit:
return
for table in self._read_path(path, chunk_metadatas):

@laysfire laysfire changed the title [data] Add orcdatasource [data] Add orc datasource Jul 6, 2026
Comment thread python/ray/data/_internal/datasource_v2/readers/orc_file_reader.py
Comment thread python/ray/data/_internal/datasource_v2/chunkers/file_chunker.py
@ray-gardener ray-gardener Bot added data Ray Data-related issues community-contribution Contributed by the community labels Jul 6, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jul 20, 2026
@richardliaw richardliaw removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jul 20, 2026
@richardliaw richardliaw added the go add ONLY when ready to merge, run all tests label Jul 20, 2026
laysfire added 3 commits July 27, 2026 16:58
Signed-off-by: yifan.xie <xyfabcd@163.com>
Signed-off-by: yifan.xie <xyfabcd@163.com>
Signed-off-by: yifan.xie <xyfabcd@163.com>
@laysfire
laysfire force-pushed the add_orcdatasource branch from 775827b to 82b21bf Compare July 27, 2026 08:58
laysfire added 2 commits July 27, 2026 18:29
Signed-off-by: yifan.xie <xyfabcd@163.com>
Signed-off-by: yifan.xie <xyfabcd@163.com>
@laysfire
laysfire requested a review from a team as a code owner July 28, 2026 02:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4ba3909. Configure here.

else:
table = table.select([])

table = self._append_synthetic_columns(path, stripe_idx, table)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path filter runs too early

Medium Severity

_read_stripe applies _predicate before _append_synthetic_columns. Filters that reference the synthesized path column (when include_paths=True) see null placeholders first, so matching rows are dropped incorrectly.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4ba3909. Configure here.

@richardliaw

Copy link
Copy Markdown
Contributor

@laysfire thanks for the contribution. we're currently merging #37891 , which should be for V1. It'd be great to rebase on top of that when done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

3 participants