MCPcopy Create free account
hub / github.com/apache/arrow / SetupSubtreePruning

Method SetupSubtreePruning

cpp/src/arrow/dataset/file_base.cc:285–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void FileSystemDataset::SetupSubtreePruning() {
286 subtrees_ = std::make_shared<FragmentSubtrees>();
287 SubtreeImpl impl;
288
289 auto encoded = impl.EncodeGuarantees(
290 [&](int index) { return fragments_[index]->partition_expression(); },
291 static_cast<int>(fragments_.size()));
292
293 std::sort(encoded.begin(), encoded.end(), SubtreeImpl::ByGuarantee());
294
295 for (const auto& e : encoded) {
296 if (e.index) {
297 subtrees_->fragments_and_subtrees.emplace_back(*e.index);
298 } else {
299 subtrees_->fragments_and_subtrees.emplace_back(impl.GetSubtreeExpression(e));
300 }
301 }
302
303 subtrees_->forest =
304 Forest(static_cast<int>(encoded.size()), SubtreeImpl::IsAncestor{encoded});
305}
306
307Result<FragmentIterator> FileSystemDataset::GetFragmentsImpl(
308 compute::Expression predicate) {

Callers 1

MakeMethod · 0.80

Calls 8

ByGuaranteeClass · 0.85
ForestClass · 0.85
EncodeGuaranteesMethod · 0.80
emplace_backMethod · 0.80
GetSubtreeExpressionMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected