Skip to content

ARROW-13572: [C++][Datasets] Add ORC support to Datasets API - #10991

Closed
jorisvandenbossche wants to merge 14 commits into
apache:masterfrom
jorisvandenbossche:ARROW-13572-dataset-orc
Closed

jorisvandenbossche wants to merge 14 commits into
apache:masterfrom
jorisvandenbossche:ARROW-13572-dataset-orc

Conversation

@jorisvandenbossche

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

This is very much work-in-progress for now. It's a basic implementation of the sync ScanFile, while I should take a look at ScanBatchesAsync instead, it still needs to support ORC options to read specific columns only (for projection pushdown), to set the batch size, no writing support yet, still need to add C++ tests and more python tests, etc.
But the basics work: you can open and read an ORC dataset.

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

This also brings up the question for the Python/Cython side: how to do this when ORC is an optional feature and might not be built by the C++ library? Currently for the datasets cython code, we assume all formats (so also Parquet) are simply always available.

@jorisvandenbossche
jorisvandenbossche marked this pull request as ready for review August 25, 2021 20:41
@jorisvandenbossche

Copy link
Copy Markdown
Member Author

cc @rjzamora it's not yet a very efficient implementation (eg no column selection pushdown), but this should already be sufficient for testing / prototyping a dask reader interfacing with this.

@lidavidm

Copy link
Copy Markdown
Member

This also brings up the question for the Python/Cython side: how to do this when ORC is an optional feature and might not be built by the C++ library? Currently for the datasets cython code, we assume all formats (so also Parquet) are simply always available.

It would be a lot of refactoring, but you could imagine having a _dataset.pyx/pxd (with the pxd containing base classes/definitions), then a _dataset_orc.pyx, _dataset_parquet.pyx, etc. with setup.py configuring everything as appropriate (e.g. --with-dataset + --with-orc implying _dataset_orc.pyx should be built). FileFormat._wrap and Fragment._wrap would get trickier, though:

@staticmethod
cdef wrap(const shared_ptr[CFileFormat]& sp):
type_name = frombytes(sp.get().type_name())
classes = {
'ipc': IpcFileFormat,
'csv': CsvFileFormat,
'parquet': ParquetFileFormat,
}
class_ = classes.get(type_name, None)
if class_ is None:
raise TypeError(type_name)
cdef FileFormat self = class_.__new__(class_)
self.init(sp)
return self

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

cc @pitrou

@pitrou pitrou 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.

Comment thread python/pyarrow/tests/test_dataset.py Resolved
Comment thread python/pyarrow/tests/test_dataset.py Resolved
Comment thread cpp/src/arrow/dataset/file_orc.h Resolved
Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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 you put all private functions and classes inside the anonymous namespace? (that is, namespace {)

The anonymous namespace is equivalent to static for functions, but also applies to classes, variables, etc.

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.

Done, only the OrcFileFormat methods are now in the public dataset namespace

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. static has become redundant here now.

Comment thread cpp/src/arrow/dataset/file_orc.cc Resolved
Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

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.

Yes, I noticed the same while working on this. Thanks for opening the JIRA.

Comment thread cpp/src/arrow/dataset/file_orc.cc Resolved
Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

Hmm, IIUC, this will only read one stripe from the ORC file, but an ORC file may well have several stripes. @iajoiner is my interpretation correct?

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.

Ah, I was assuming this would iteratively read the "next" stripe on each call of the iterator, but I might have misunderstood that.

We also have https://issues.apache.org/jira/browse/ARROW-13571 to control the stripe size when writing, which will also make it easier to test this with small datasets.

@jorisvandenbossche jorisvandenbossche Aug 30, 2021 •

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.

OK, indeed, doing a quick test with writing a file with 10 million rows (so it has 2 stripes), and reading it back with the datasets API of this PR, it only reads around 8 million rows .. (so only the first stripe).
So will have to look for a different way.

@jorisvandenbossche jorisvandenbossche Aug 31, 2021 •

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.

I pushed an update, and now manually iteratively read the next stripe with ReadStripe (I followed the approach of a ScanTaskIterator from file_ipc.cc).
(this doesn't support batch_size anymore, since ReadStripe always returns a single record batch, but that's something that can be improved later, I suppose)

@iajoiner iajoiner Feb 6, 2022 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@pitrou Sorry I'm really late here. For the record the answer is "Yes" which I think all three of us already knew haha.

@iajoiner

Copy link
Copy Markdown

Sorry I just did a legal name change and have been too busy dealing with the bureaucracy to support this one. Yes I will answer the questions tonight or tomorrow.

@jorisvandenbossche jorisvandenbossche left a comment

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.

Thanks for the review!

Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

Done, only the OrcFileFormat methods are now in the public dataset namespace

Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

Yes, I noticed the same while working on this. Thanks for opening the JIRA.

Comment thread cpp/src/arrow/dataset/file_orc.h Resolved
Comment thread cpp/src/arrow/dataset/file_orc.cc Resolved
Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

Ah, I was assuming this would iteratively read the "next" stripe on each call of the iterator, but I might have misunderstood that.

We also have https://issues.apache.org/jira/browse/ARROW-13571 to control the stripe size when writing, which will also make it easier to test this with small datasets.

@pitrou

pitrou commented Aug 30, 2021

Copy link
Copy Markdown
Member

Sorry I just did a legal name change and have been too busy dealing with the bureaucracy to support this one. Yes I will answer the questions tonight or tomorrow.

No worries :-)

@jorisvandenbossche
jorisvandenbossche force-pushed the ARROW-13572-dataset-orc branch 3 times, most recently from b5389ad to 705f27c Compare August 31, 2021 08:20
Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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.

The potential error return should not be ignored here.

Comment thread cpp/src/arrow/dataset/file_orc.cc Outdated

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. static has become redundant here now.

Comment thread cpp/src/arrow/dataset/file_orc.cc Resolved
@pitrou

pitrou commented Aug 31, 2021

Copy link
Copy Markdown
Member

Hmm, unfortunately there are linker errors when building the Cython bindings with ORC disabled (see AppVeyor errors). Perhaps an optional _dataset_orc module will be needed.

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

Hmm, unfortunately there are linker errors when building the Cython bindings with ORC disabled (see AppVeyor errors). Perhaps an optional _dataset_orc module will be needed.

Yes, I know (see #10991 (comment)), but not fully sure how to this can be done in practice. @lidavidm described a possible way to do this above (#10991 (comment)), but do you have an idea how we could handle FileFormat._wrap and Fragment._wrap? I don't think with cython we can "conditionally" import symbols from another file? (that might need some of kind of register mechanism?)

@pitrou

pitrou commented Aug 31, 2021

Copy link
Copy Markdown
Member

Well, it seems it should be as simple as:

try:
    from pyarrow._dataset_orc import OrcFileFormat
except ImportError:
    OrcFileFormat = None

@jorisvandenbossche

jorisvandenbossche commented Sep 9, 2021 •

Copy link
Copy Markdown
Member Author

Well, it seems it should be as simple as:

Ah, indeed it is. I was assuming that since the class is being used in the cdef wrap method, the class would have to be cimported (which wouldn't be possible in such a conditional import).

Now, there is still some circular import issue.
For normal usage, everything seems fine. But if you import pyarrow._dataset_orc directly (and before importing pyarrow.dataset) in python, you get errors. I don't know exactly how the import machinery is working at this point (and the interaction with the cython-generated module), but so it seems that when importing pyarrow._dataset_orc, it also (logically) does import pyarrow._dataset. And at that point, pyarrow._dataset cannot import OrcFileFormat, and it will be set to None (leading to FileFormat.wrap(..) not recognizing an orc file format). But if you first import pyarrow._dataset (which will import pyarrow._dataset_orc), then everything is fine:

# working with only import pyarrow.dataset
>>> import pyarrow.dataset as ds
>>> dataset = ds.dataset("test.orc", format="orc")
>>> dataset.format
<pyarrow._dataset_orc.OrcFileFormat at 0x7f203ddc78b0>

vs

# not working when first import pyarrow._dataset_orc
>>> from pyarrow._dataset_orc import OrcFileFormat
cannot import name OrcFileFormat   # print statement added in _dataset.pyx to print ImportError
>>> import pyarrow.dataset as ds
>>> dataset = ds.dataset("test.orc", format="orc")
>>> dataset.format
...
~/scipy/repos/arrow/python/pyarrow/_dataset.pyx in pyarrow._dataset.FileFormat.wrap()
TypeError: orc

Looking at the generated cpp code, the difference might be that for _dataset_orc, the import of _dataset happens at module initialization, while for _dataset, the import of _dataset_orc is a runtime import.

Would there be a way to resolve this issue? Or are we fine to accept this limitation? (in practice, a user should never import from the private _dataset_orc module, but it's a confusing error message if you did for some reason)

UPDATE: solved with importing it only when needed (on first usage in FileFormat.wrap)

@jorisvandenbossche
jorisvandenbossche force-pushed the ARROW-13572-dataset-orc branch 2 times, most recently from e123713 to 25e1b51 Compare September 13, 2021 16:56
@jorisvandenbossche

Copy link
Copy Markdown
Member Author

This should be ready for another review round.

Comment thread python/pyarrow/_dataset.pyx Outdated

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.

"file format" rather than "filesystem", no?

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.

Yes :)

Comment thread cpp/src/arrow/dataset/file_orc.cc Resolved
Comment thread python/pyarrow/_dataset.pyx Resolved
@jorisvandenbossche

Copy link
Copy Markdown
Member Author

@pitrou could you give this another look?

The C++ failures seem unrelated (one is an S3 test failure, and the other a CSV skip rows test failure), but can rebase once more to see if that helps.

@pitrou pitrou 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.

LGTM, just two questions. Feel free to go ahead.

Comment thread python/pyarrow/tests/test_dataset.py Outdated

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.

Did you open a JIRA for this?

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.

Ah, not yet for this follow-up. Created https://issues.apache.org/jira/browse/ARROW-14153 and added that in the TODO comment

Comment thread python/pyarrow/tests/test_dataset.py Outdated

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.

Are the fixtures actually necessary 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.

Indeed, not necessary here.

@kou

kou commented Oct 5, 2021

Copy link
Copy Markdown
Member

@jorisvandenbossche It seems that this breaks java-jars daily build: https://github.com/ursacomputing/crossbow/runs/3740820445

FAILED: src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx.o 
/usr/local/bin/ccache /opt/rh/devtoolset-9/root/usr/bin/c++ -DARROW_DS_EXPORTING -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_AVX512 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_JEMALLOC -DARROW_JEMALLOC_INCLUDE_DIR="" -DARROW_WITH_LZ4 -DARROW_WITH_RE2 -DARROW_WITH_SNAPPY -DARROW_WITH_TIMING_TESTS -DARROW_WITH_UTF8PROC -DARROW_WITH_ZLIB -DARROW_WITH_ZSTD -DURI_STATIC_BUILD -DUTF8PROC_STATIC -Isrc -I/arrow/cpp/src -I/arrow/cpp/src/generated -I/arrow/cpp/src/parquet -isystem /arrow/cpp/thirdparty/flatbuffers/include -isystem /opt/vcpkg/installed/x64-linux-static-release/include -isystem jemalloc_ep-prefix/src -isystem /opt/vcpkg/installed/x64-linux-static-release/share/rapidjson/../../include -isystem xsimd_ep/src/xsimd_ep-install/include -isystem /arrow/cpp/thirdparty/hadoop/include -Wno-noexcept-type -Wno-subobject-linkage  -fdiagnostics-color=always -O3 -DNDEBUG  -Wall -fno-semantic-interposition -msse4.2  -O3 -DNDEBUG -fPIC -std=c++11 -MD -MT src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx.o -MF src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx.o.d -o src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx.o -c src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:10:
/arrow/cpp/src/arrow/dataset/file_orc.cc: In member function ‘virtual arrow::Result<bool> arrow::dataset::OrcFileFormat::IsSupported(const arrow::dataset::FileSource&) const’:
/arrow/cpp/src/arrow/dataset/file_orc.cc:136:27: error: call of overloaded ‘OpenReader(const arrow::dataset::FileSource&)’ is ambiguous
  136 |   return OpenReader(source).ok();
      |                           ^
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:6:
/arrow/cpp/src/arrow/dataset/file_ipc.cc:46:67: note: candidate: ‘arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchFileReader> > arrow::dataset::OpenReader(const arrow::dataset::FileSource&, const arrow::ipc::IpcReadOptions&)’
   46 | static inline Result<std::shared_ptr<ipc::RecordBatchFileReader>> OpenReader(
      |                                                                   ^~~~~~~~~~
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:10:
/arrow/cpp/src/arrow/dataset/file_orc.cc:38:69: note: candidate: ‘arrow::Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader> > arrow::dataset::{anonymous}::OpenReader(const arrow::dataset::FileSource&, const std::shared_ptr<arrow::dataset::ScanOptions>&)’
   38 | inline Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader>> OpenReader(
      |                                                                     ^~~~~~~~~~
In file included from /arrow/cpp/src/arrow/array/data.h:27,
                 from /arrow/cpp/src/arrow/datum.h:27,
                 from /arrow/cpp/src/arrow/compute/exec/expression.h:28,
                 from /arrow/cpp/src/arrow/dataset/dataset.h:28,
                 from /arrow/cpp/src/arrow/dataset/dataset.cc:18,
                 from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:3:
/arrow/cpp/src/arrow/dataset/file_orc.cc: In member function ‘virtual arrow::Result<std::shared_ptr<arrow::Schema> > arrow::dataset::OrcFileFormat::Inspect(const arrow::dataset::FileSource&) const’:
/arrow/cpp/src/arrow/dataset/file_orc.cc:140:55: error: call of overloaded ‘OpenReader(const arrow::dataset::FileSource&)’ is ambiguous
  140 |   ARROW_ASSIGN_OR_RAISE(auto reader, OpenReader(source));
      |                                                       ^
/arrow/cpp/src/arrow/result.h:452:25: note: in definition of macro ‘ARROW_ASSIGN_OR_RAISE_IMPL’
  452 |   auto&& result_name = (rexpr);                                                          \
      |                         ^~~~~
/arrow/cpp/src/arrow/dataset/file_orc.cc:140:3: note: in expansion of macro ‘ARROW_ASSIGN_OR_RAISE’
  140 |   ARROW_ASSIGN_OR_RAISE(auto reader, OpenReader(source));
      |   ^~~~~~~~~~~~~~~~~~~~~
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:6:
/arrow/cpp/src/arrow/dataset/file_ipc.cc:46:67: note: candidate: ‘arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchFileReader> > arrow::dataset::OpenReader(const arrow::dataset::FileSource&, const arrow::ipc::IpcReadOptions&)’
   46 | static inline Result<std::shared_ptr<ipc::RecordBatchFileReader>> OpenReader(
      |                                                                   ^~~~~~~~~~
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:10:
/arrow/cpp/src/arrow/dataset/file_orc.cc:38:69: note: candidate: ‘arrow::Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader> > arrow::dataset::{anonymous}::OpenReader(const arrow::dataset::FileSource&, const std::shared_ptr<arrow::dataset::ScanOptions>&)’
   38 | inline Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader>> OpenReader(
      |                                                                     ^~~~~~~~~~
In file included from /arrow/cpp/src/arrow/array/data.h:27,
                 from /arrow/cpp/src/arrow/datum.h:27,
                 from /arrow/cpp/src/arrow/compute/exec/expression.h:28,
                 from /arrow/cpp/src/arrow/dataset/dataset.h:28,
                 from /arrow/cpp/src/arrow/dataset/dataset.cc:18,
                 from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:3:
/arrow/cpp/src/arrow/dataset/file_orc.cc: In lambda function:
/arrow/cpp/src/arrow/dataset/file_orc.cc:159:69: error: call of overloaded ‘OpenReader(const arrow::dataset::FileSource&)’ is ambiguous
  159 |         ARROW_ASSIGN_OR_RAISE(auto reader, OpenReader(file->source()));
      |                                                                     ^
/arrow/cpp/src/arrow/result.h:452:25: note: in definition of macro ‘ARROW_ASSIGN_OR_RAISE_IMPL’
  452 |   auto&& result_name = (rexpr);                                                          \
      |                         ^~~~~
/arrow/cpp/src/arrow/dataset/file_orc.cc:159:9: note: in expansion of macro ‘ARROW_ASSIGN_OR_RAISE’
  159 |         ARROW_ASSIGN_OR_RAISE(auto reader, OpenReader(file->source()));
      |         ^~~~~~~~~~~~~~~~~~~~~
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:6:
/arrow/cpp/src/arrow/dataset/file_ipc.cc:46:67: note: candidate: ‘arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchFileReader> > arrow::dataset::OpenReader(const arrow::dataset::FileSource&, const arrow::ipc::IpcReadOptions&)’
   46 | static inline Result<std::shared_ptr<ipc::RecordBatchFileReader>> OpenReader(
      |                                                                   ^~~~~~~~~~
In file included from src/arrow/dataset/CMakeFiles/arrow_dataset_objlib.dir/Unity/unity_0_cxx.cxx:10:
/arrow/cpp/src/arrow/dataset/file_orc.cc:38:69: note: candidate: ‘arrow::Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader> > arrow::dataset::{anonymous}::OpenReader(const arrow::dataset::FileSource&, const std::shared_ptr<arrow::dataset::ScanOptions>&)’
   38 | inline Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader>> OpenReader(
      |                                                                     ^~~~~~~~~~

Could you confirm this?

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

@kou the error is certainly coming from code added in this PR. But I don't directly understand the error / why it errors in that build (I not familiar with the java-jars build).
I opened https://issues.apache.org/jira/browse/ARROW-14241 to track this.

@kou

kou commented Oct 6, 2021

Copy link
Copy Markdown
Member

Thanks for confirming this.
I don't know why but java-jars build failure has gone since 2021-10-06 daily build...: https://lists.apache.org/thread.html/r4a20c19088d6f21f961494d54d7c98a9d9c5ca1403b566e3ae93521e%40%3Cbuilds.arrow.apache.org%3E

I close the opened issue. Sorry.

@kou

kou commented Oct 6, 2021

Copy link
Copy Markdown
Member

Ah, #11343 fixes something. I don't touch the opened issue.

ViniciusSouzaRoque pushed a commit to s1mbi0se/arrow that referenced this pull request Oct 20, 2021
Closes apache#10991 from jorisvandenbossche/ARROW-13572-dataset-orc

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
@rjzamora

rjzamora commented Nov 1, 2021 •

Copy link
Copy Markdown
Contributor

Thanks for all the great work here @jorisvandenbossche!

In order to utilize the Dataset API for read_orc in Dask, we will need an API to split file-level fragments into stripe-level fragments. For example, for parquet datasets there is a split_by_row_group method.

We also want to be able to select a subset of stripes from a file fragment to produce a new dataset fragment. For example, for parquet datasets we can do old_frag.format.make_fragment(..., row_groups=selected_row_group_indices).

Does it make sense for me to raise separate Jira issues for these features? Or, is this functionality already available?

@westonpace

Copy link
Copy Markdown
Member

@rjzamora @jorisvandenbossche A new JIRA sounds good to me. We can probably make this a general purpose feature of the datasets API (although maybe naming it split_by_record_batch) since the same logic would hold for parquet, ipc, and orc. For formats that don't support the feature (e.g. CSV) they could just return the same fragments.

@jorisvandenbossche

Copy link
Copy Markdown
Member Author

@rjzamora would you like to create a JIRA for this?

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.

7 participants