bkietz commented on a change in pull request #7526:
URL: https://github.com/apache/arrow/pull/7526#discussion_r444914459
##########
File path: cpp/src/arrow/dataset/file_parquet.cc
##########
@@ -357,13 +355,20 @@ static inline Result<std::vector<RowGroupInfo>>
AugmentRowGroups(
return row_groups;
}
-Result<ScanTaskIterator> ParquetFileFormat::ScanFile(
- const FileSource& source, std::shared_ptr<ScanOptions> options,
- std::shared_ptr<ScanContext> context, std::vector<RowGroupInfo>
row_groups) const {
+Result<ScanTaskIterator>
ParquetFileFormat::ScanFile(std::shared_ptr<ScanOptions> options,
+
std::shared_ptr<ScanContext> context,
+ FileFragment* fragment)
const {
+ const auto& source = fragment->source();
+ auto row_groups = checked_cast<const
ParquetFileFragment*>(fragment)->row_groups();
+
bool row_groups_are_complete = RowGroupInfosAreComplete(row_groups);
// The following block is required to avoid any IO if all RowGroups are
// excluded due to prior statistics knowledge.
if (row_groups_are_complete) {
+ // physical_schema should be cached at this point
+ ARROW_ASSIGN_OR_RAISE(auto physical_schema,
fragment->ReadPhysicalSchema());
+ RETURN_NOT_OK(options->filter->Validate(*physical_schema));
Review comment:
Fragments created by ParquetDatasetFactory will have their physical
schema populated on construction:
https://github.com/apache/arrow/pull/7526/files#diff-b7aed3b5c0adacff778c6930cc6a03e4R646-R650
After that calling `ReadPhysicalSchema` on those fragments will be an
IO-free operation
https://github.com/apache/arrow/pull/7526/files#diff-ce896c4eb96f3a050aec23151adf58e8R42-R48
----------------------------------------------------------------
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]