New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-8318: [C++][Dataset] Construct FileSystemDataset from fragments #7073
ARROW-8318: [C++][Dataset] Construct FileSystemDataset from fragments #7073
Conversation
Shouldn't we require that? That seems the goal of UnionDataset to combine datasets with different formats |
Maybe, this is still enforced if you use the Factory, but you can create a FileSystemDataset with fragments from different file format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, thanks!
fragment_partitions[ref.i] = FoldingAnd(fragment_partitions[parent.i], partition); | ||
} else { | ||
fragment_partitions[ref.i] = FoldingAnd(partition_expression_, partition); | ||
for (const auto& fragment : fragments_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up for sub tree pruning https://issues.apache.org/jira/browse/ARROW-8658
Due to R failure (that I didn't catch because my installation was broken and using and old version of arrow), I'll revert the FileSystemDataset::format and make sure they're homogeneous. |
From a user perspective, I find that also an added convenience. In Python, the |
This makes me wonder, why do we need FileSystemDataset and/or UnionDataset at all? Because all of the filesystem and format specific logic is implemented by the discovery objects? It implies that we could define dataset as a vector of arbitrary fragments.
|
Do we need FileSystemDataset, maybe not. Is it still useful, IMO yes. As mentioned above, I personally find it convenient to know that my dataset has a single format / filesystem, and be able to easily check this format. |
WRT convenient single format or single file system datasets, it would be straightforward (and possibly more useful) to provide accessories for subsets, Dataset.subsets(by_format=True): { format: subset ... } Or similar. IMHO the convenience added does not justify a whole class, at least in C++. As you noted even if we remove it in C++ it could still be a convenience subclass in Python |
The ParquetFileSystemDataset will hold a |
* Simplified FileSystemDataset to hold a FragmentVector. Each Fragment must be a FileFragment and is checked at `FileSystemDataset::Make`. Fragments are not required to use the same backing filesystem nor the same format. * Removed `FileSystemDataset::format` and `FileSystemDataset::partitions`. * Since FileInfo is not required by neither FileSystemDataset and FileSystemDatasetFactory, it is no possible to create a dataset without any IO involved. * Re-introduced the natural behavior of creating FileFragment with their full partition expressions instead of removing the ancestors common partitions. * Added `Expression::IsSatisfiableWith` method. * Added missing compression cmake options to archery. * Ensure FileSource holds a shared_ptr<FileSystem> pointer. This is required to refactor FileSystemDataset to support Buffer FileSource and heterogeneous FileSystems. * Rename `type` to `id`, following other classes.
7774dd7
to
d2263be
Compare
5b70f4b
to
80df00e
Compare
I'd like elaborate a bit more on the generic dataset class regardless what kind of wrappers do we provide.
|
Simplified FileSystemDataset to hold a FragmentVector. Each Fragment must be a FileFragment and is checked at
FileSystemDataset::Make
. Fragments are not required to use the same backing filesystem nor the same format.Removed
FileSystemDataset::format
andFileSystemDataset::partitions
.Since FileInfo is not required by neither FileSystemDataset and FileSystemDatasetFactory, it is possible to create a dataset without any IO involved.
Re-introduced the natural behavior of creating FileFragment with their full partition expressions instead of removing the ancestors common partitions.
Added
Expression::IsSatisfiableWith
method.Added missing compression cmake options to archery.
Ensure FileSource holds a shared_ptr pointer. This is required to refactor FileSystemDataset to support Buffer FileSource and heterogeneous FileSystems.
Rename
type
toid
, following other classes.