Skip to content

Refactor and Expand Dask-Dataframe ORC API - #7756

Merged
jrbourbeau merged 25 commits into
dask:mainfrom
rjzamora:orc-refactor
Aug 5, 2021
Merged

jrbourbeau merged 25 commits into
dask:mainfrom
rjzamora:orc-refactor

Conversation

@rjzamora

@rjzamora rjzamora commented Jun 3, 2021 •

Copy link
Copy Markdown
Member

TODO:

  • (GENERAL) Refactor existing read_orc API to expose a customizable engine interface
  • (GENERAL) Test coverage for all new features
  • (WRITE) Add basic to_orc support for pyarrow-4.0
  • (WRITE) Support write_index option
  • (READ) Support index
  • (READ) Support partition_stripe_count (similar to parquet's split_row_groups)
  • (READ) Support aggregate_files option for multi-file partitions (solution/API should match Add aggregate_files argument to enable multi-file partitions in read_parquet #7557 )

Planned for a Follow-up PR:

  • (WRITE) Support append
  • (WRITE) Support partition_on
  • (READ) Support "hive-like" directory partitioning

@rjzamora

rjzamora commented Jun 3, 2021

Copy link
Copy Markdown
Member Author

@randerzander @VibhuJawa - This is still early and rough, but please feel free to suggest specific API requirements to help guide the progress.

@rjzamora rjzamora changed the title [WIP] Refactor and Expand Dask-Dataframe ORC API Refactor and Expand Dask-Dataframe ORC API Jul 27, 2021
@rjzamora
rjzamora marked this pull request as ready for review July 27, 2021 16:17
@rjzamora

Copy link
Copy Markdown
Member Author

@dask/io - I am highly motivated to support partition_on in ORC (on the read and write side), but I'd like to implement that seperately. This PR is makes the necessary changes to mimic the parquet-Engine approach so that downstream libraries (like dask-cudf) can resuse the dask-dataframe logic for reading ORC datasets with multi-stripe and multi-file output partitions.

Comment thread dask/dataframe/io/tests/test_orc.py Resolved
Comment thread dask/dataframe/io/tests/test_orc.py Resolved
Comment thread dask/dataframe/io/tests/test_orc.py Resolved
Comment thread dask/dataframe/io/tests/test_orc.py Resolved
Comment thread dask/dataframe/io/tests/test_orc.py Resolved
@rjzamora

Copy link
Copy Markdown
Member Author

I'm not sure why the new test failed while writing the test files with pyorc, but I'm hoping is was just a fluke (otherwise, I'm not really sure how to test the offset file-aggregation behavior).

Comment thread dask/dataframe/io/tests/test_orc.py Resolved
Comment thread dask/dataframe/io/tests/test_orc.py Resolved
@jrbourbeau

Copy link
Copy Markdown
Member

cc @martindurant @jorisvandenbossche in case either of you have thoughts on this

Comment thread dask/dataframe/io/orc/core.py Resolved
@jorisvandenbossche

Copy link
Copy Markdown
Member

This currently does not support partitioned datasets, right?
Is there interest in having that as well? The ORC file format is not yet supported in the pyarrow.datasets API to discover partitioned datasets, but that could be added. And then I suppose it could be used similarly as in the Parquet engine to read partitioned datasets.

@rjzamora

rjzamora commented Aug 5, 2021 •

Copy link
Copy Markdown
Member Author

This currently does not support partitioned datasets, right? Is there interest in having that as well?

Right - I have (mostly/roughly) implemented partitioning in a separate branch for a follow-up PR.

The ORC file format is not yet supported in the pyarrow.datasets API to discover partitioned datasets, but that could be added. And then I suppose it could be used similarly as in the Parquet engine to read partitioned datasets.

Yes. There are RAPIDS uses who would absolutely benefit from having ORC support within the pyarrow.datasets API

EDIT: Added a JIRA issue here

@martindurant

Copy link
Copy Markdown
Member

Yes. There are RAPIDS uses who would absolutely benefit from having ORC support within the pyarrow.datasets API

ORC could just be another parquet engine!

@martindurant martindurant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All looks very good to me. I left some very minor comments.


# Convert root directory to file list.
# TODO: Handle hive-partitioned data
if len(paths) == 1 and not fs.isfile(paths[0]):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can paths be a string here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No - to_parquet will use get_fs_token_paths to ensure this paths input is a list.

Comment thread dask/dataframe/io/orc/arrow.py Resolved
Comment thread dask/dataframe/io/orc/utils.py Resolved

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @rjzamora! It looks like folks are general in favor of the changes here. I'll plan to merge this after CI finishes up

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants