bkietz commented on a change in pull request #9670:
URL: https://github.com/apache/arrow/pull/9670#discussion_r592354257



##########
File path: cpp/src/arrow/dataset/file_base.h
##########
@@ -234,16 +234,24 @@ class ARROW_DS_EXPORT FileSystemDataset : public Dataset {
   std::string ToString() const;
 
  protected:
+  explicit FileSystemDataset(std::shared_ptr<Schema> schema)
+      : Dataset(std::move(schema)) {}
+
+  FileSystemDataset(std::shared_ptr<Schema> schema, Expression 
partition_expression)
+      : Dataset(std::move(schema), partition_expression) {}
+
   Result<FragmentIterator> GetFragmentsImpl(Expression predicate) override;
 
-  FileSystemDataset(std::shared_ptr<Schema> schema, Expression root_partition,
-                    std::shared_ptr<FileFormat> format,
-                    std::shared_ptr<fs::FileSystem> filesystem,
-                    std::vector<std::shared_ptr<FileFragment>> fragments);
+  void SetupSubtreePruning();
 
   std::shared_ptr<FileFormat> format_;
   std::shared_ptr<fs::FileSystem> filesystem_;
   std::vector<std::shared_ptr<FileFragment>> fragments_;
+
+  // Forest for skipping fragments based on extracted subtree expressions
+  Forest forest_;
+  // fragment indices and subtree expressions in forest order
+  std::vector<util::Variant<int, Expression>> fragments_and_subtrees_;

Review comment:
       We might prefer to wrap these in a pimpl so that Forest can be made 
internal




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to