pitrou commented on a change in pull request #10636:
URL: https://github.com/apache/arrow/pull/10636#discussion_r662400184
##########
File path: cpp/src/arrow/dataset/file_parquet.h
##########
@@ -352,15 +352,17 @@ class ARROW_DS_EXPORT ParquetDatasetFactory : public
DatasetFactory {
std::shared_ptr<parquet::arrow::SchemaManifest> manifest,
std::shared_ptr<Schema> physical_schema, std::string base_path,
ParquetFactoryOptions options,
- std::unordered_map<std::string, std::vector<int>> path_to_row_group_ids)
+ std::unordered_map<std::string, std::vector<int>> path_to_row_group_ids,
+ std::vector<std::string> ordered_paths)
Review comment:
Why not take a single `std::vector<std::string, std::vector<int>>
path_to_row_groups_ids` instead?
##########
File path: python/pyarrow/tests/test_dataset.py
##########
@@ -2704,6 +2704,24 @@ def test_parquet_dataset_factory(tempdir):
assert result.num_rows == 40
[email protected]
+def test_parquet_dataset_factory_order(tempdir):
+ import pyarrow.parquet as pq
Review comment:
Add a comment explaining what this tests?
##########
File path: cpp/src/arrow/dataset/file_parquet.cc
##########
@@ -868,6 +868,7 @@ Result<std::shared_ptr<DatasetFactory>>
ParquetDatasetFactory::Make(
ARROW_ASSIGN_OR_RAISE(auto manifest, GetSchemaManifest(*metadata,
properties));
std::unordered_map<std::string, std::vector<int>> path_to_row_group_ids;
+ std::vector<std::string> ordered_paths;
Review comment:
Or:
```c++
std::vector<std::string, std::vector<int>> path_to_row_group_ids;
std::unordered_map<util::string_view, size_t> path_to_index;
for (int i = 0; i < metadata->num_row_groups(); i++) {
// ...
const auto p = path_to_index.emplace(path, path_to_row_group_ids.size());
if (p.second) {
path_to_row_group_ids.push_back({std::move(path), {}});
}
path_to_row_group_ids[p.first->second].push_back(i);
```
--
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]