ManManson commented on code in PR #13804:
URL: https://github.com/apache/arrow/pull/13804#discussion_r941481291
##########
cpp/src/arrow/dataset/dataset.cc:
##########
@@ -160,6 +160,25 @@ Result<FragmentIterator>
Dataset::GetFragments(compute::Expression predicate) {
:
MakeEmptyIterator<std::shared_ptr<Fragment>>();
}
+Result<FragmentGenerator> Dataset::GetFragmentsAsync() {
+ return GetFragmentsAsync(compute::literal(true));
+}
+
+Result<FragmentGenerator> Dataset::GetFragmentsAsync(compute::Expression
predicate) {
+ ARROW_ASSIGN_OR_RAISE(
+ predicate, SimplifyWithGuarantee(std::move(predicate),
partition_expression_));
+ return predicate.IsSatisfiable() ?
GetFragmentsAsyncImpl(std::move(predicate))
+ :
MakeEmptyGenerator<std::shared_ptr<Fragment>>();
+}
+
+// Default impl delegating the work to `GetFragmentsImpl` and wrapping it into
a
+// VectorGenerator
+Result<FragmentGenerator> Dataset::GetFragmentsAsyncImpl(compute::Expression
predicate) {
+ ARROW_ASSIGN_OR_RAISE(auto iter, GetFragmentsImpl(std::move(predicate)));
+ ARROW_ASSIGN_OR_RAISE(auto vec, iter.ToVector());
Review Comment:
Good idea. Will do.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]