| 983 | } |
| 984 | |
| 985 | Result<std::optional<int64_t>> ParquetFileFragment::TryCountRows( |
| 986 | compute::Expression predicate) { |
| 987 | DCHECK_NE(metadata_, nullptr); |
| 988 | if (ExpressionHasFieldRefs(predicate)) { |
| 989 | ARROW_ASSIGN_OR_RAISE(auto expressions, TestRowGroups(std::move(predicate))); |
| 990 | int64_t rows = 0; |
| 991 | for (size_t i = 0; i < row_groups_->size(); i++) { |
| 992 | // If the row group is entirely excluded, exclude it from the row count |
| 993 | if (!expressions[i].IsSatisfiable()) continue; |
| 994 | // Unless the row group is entirely included, bail out of fast path |
| 995 | if (expressions[i] != compute::literal(true)) return std::nullopt; |
| 996 | BEGIN_PARQUET_CATCH_EXCEPTIONS |
| 997 | rows += metadata()->RowGroup((*row_groups_)[i])->num_rows(); |
| 998 | END_PARQUET_CATCH_EXCEPTIONS |
| 999 | } |
| 1000 | return rows; |
| 1001 | } |
| 1002 | return metadata()->num_rows(); |
| 1003 | } |
| 1004 | |
| 1005 | // |
| 1006 | // ParquetFragmentScanOptions |
no test coverage detected