You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/29 15:55:08 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #8301: ARROW-10100: [C++][Python][Dataset] Add ParquetFileFragment::Subset method

jorisvandenbossche commented on a change in pull request #8301:
URL: https://github.com/apache/arrow/pull/8301#discussion_r496842872



##########
File path: cpp/src/arrow/dataset/file_parquet.cc
##########
@@ -575,6 +575,39 @@ Result<FragmentVector> ParquetFileFragment::SplitByRowGroup(
   return fragments;
 }
 
+Result<std::shared_ptr<Fragment>> ParquetFileFragment::Subset(
+    const std::shared_ptr<Expression>& predicate) {
+  RETURN_NOT_OK(EnsureCompleteMetadata());
+  ARROW_ASSIGN_OR_RAISE(auto row_groups, FilterRowGroups(*predicate));
+
+  ARROW_ASSIGN_OR_RAISE(auto new_fragment,
+                        parquet_format_.MakeFragment(source_, partition_expression(),
+                                                     row_groups, physical_schema_));
+  return new_fragment;
+}
+
+Result<std::shared_ptr<Fragment>> ParquetFileFragment::Subset(
+    const std::vector<int> row_group_ids) {
+  std::vector<RowGroupInfo> row_groups;
+

Review comment:
       Here I would still need to check that all row_group_ids exist in the fragment




----------------------------------------------------------------
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:
users@infra.apache.org