be/src/format_v2/parquet/parquet_profile.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include "format_v2/parquet/parquet_profile.h" |
19 | | |
20 | | #include "format_v2/parquet/parquet_statistics.h" |
21 | | #include "runtime/file_scan_profile.h" |
22 | | |
23 | | namespace doris::format::parquet { |
24 | | |
25 | 552 | void ParquetProfile::init(RuntimeProfile* profile) { |
26 | 552 | if (profile == nullptr) { |
27 | 208 | return; |
28 | 208 | } |
29 | | |
30 | 344 | file_scan_profile::ensure_hierarchy(profile); |
31 | 344 | static const char* parquet_profile = "ParquetReader"; |
32 | 344 | total_time = |
33 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, parquet_profile, file_scan_profile::FILE_READER, 1); |
34 | 344 | refresh_scan_request_time = |
35 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "RefreshScanRequestTime", parquet_profile, 1); |
36 | | |
37 | | // Row-group counters are part of the long-standing ParquetReader profile contract. Keep them |
38 | | // below the format node so profile parsers and operators can attribute pruning to Parquet. |
39 | 344 | filtered_row_groups = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RowGroupsFiltered", TUnit::UNIT, |
40 | 344 | parquet_profile, 1); |
41 | 344 | filtered_row_groups_by_min_max = ADD_CHILD_COUNTER_WITH_LEVEL( |
42 | 344 | profile, "RowGroupsFilteredByMinMax", TUnit::UNIT, parquet_profile, 1); |
43 | 344 | filtered_row_groups_by_dictionary = ADD_CHILD_COUNTER_WITH_LEVEL( |
44 | 344 | profile, "RowGroupsFilteredByDictionary", TUnit::UNIT, parquet_profile, 1); |
45 | 344 | filtered_row_groups_by_bloom_filter = ADD_CHILD_COUNTER_WITH_LEVEL( |
46 | 344 | profile, "RowGroupsFilteredByBloomFilter", TUnit::UNIT, parquet_profile, 1); |
47 | 344 | filtered_row_groups_by_page_index = ADD_CHILD_COUNTER_WITH_LEVEL( |
48 | 344 | profile, "RowGroupsFilteredByPageIndex", TUnit::UNIT, parquet_profile, 1); |
49 | 344 | to_read_row_groups = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RowGroupsReadNum", TUnit::UNIT, |
50 | 344 | parquet_profile, 1); |
51 | 344 | total_row_groups = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RowGroupsTotalNum", TUnit::UNIT, |
52 | 344 | parquet_profile, 1); |
53 | 344 | selected_row_ranges = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SelectedRowRanges", TUnit::UNIT, |
54 | 344 | parquet_profile, 1); |
55 | 344 | filtered_group_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FilteredRowsByGroup", TUnit::UNIT, |
56 | 344 | parquet_profile, 1); |
57 | 344 | filtered_page_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FilteredRowsByPage", TUnit::UNIT, |
58 | 344 | parquet_profile, 1); |
59 | 344 | variant_leaf_projections = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "VariantLeafProjections", |
60 | 344 | TUnit::UNIT, parquet_profile, 1); |
61 | 344 | pages_skipped_by_data_page_filter = ADD_CHILD_COUNTER_WITH_LEVEL( |
62 | 344 | profile, "PagesSkippedByDataPageFilter", TUnit::UNIT, parquet_profile, 1); |
63 | 344 | data_page_filter_skip_bytes = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "DataPageFilterSkipBytes", |
64 | 344 | TUnit::BYTES, parquet_profile, 1); |
65 | 344 | selected_rows = |
66 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SelectedRows", TUnit::UNIT, parquet_profile, 1); |
67 | | // Keep every Parquet scan metric below the format node: profile consumers extract that |
68 | | // subtree and otherwise silently lose this counter even though filtering happened. |
69 | 344 | rows_filtered_by_conjunct = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RowsFilteredByConjunct", |
70 | 344 | TUnit::UNIT, parquet_profile, 1); |
71 | 344 | total_batches = |
72 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "TotalBatches", TUnit::UNIT, parquet_profile, 1); |
73 | 344 | dense_batches = |
74 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "DenseBatches", TUnit::UNIT, parquet_profile, 1); |
75 | 344 | selected_batches = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SelectedBatches", TUnit::UNIT, |
76 | 344 | parquet_profile, 1); |
77 | 344 | empty_selection_batches = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "EmptySelectionBatches", |
78 | 344 | TUnit::UNIT, parquet_profile, 1); |
79 | 344 | range_gap_skipped_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RangeGapSkippedRows", |
80 | 344 | TUnit::UNIT, parquet_profile, 1); |
81 | 344 | reader_read_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "ReaderReadRows", TUnit::UNIT, |
82 | 344 | parquet_profile, 1); |
83 | 344 | reader_skip_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "ReaderSkipRows", TUnit::UNIT, |
84 | 344 | parquet_profile, 1); |
85 | 344 | reader_select_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "ReaderSelectRows", TUnit::UNIT, |
86 | 344 | parquet_profile, 1); |
87 | 344 | level_only_read_time = |
88 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "LevelOnlyReadTime", parquet_profile, 1); |
89 | 344 | level_only_skip_time = |
90 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "LevelOnlySkipTime", parquet_profile, 1); |
91 | 344 | materialization_time = |
92 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "MaterializationTime", parquet_profile, 1); |
93 | 344 | variant_reconstruction_time = |
94 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "VariantReconstructionTime", parquet_profile, 1); |
95 | 344 | variant_reconstructed_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "VariantReconstructedRows", |
96 | 344 | TUnit::UNIT, parquet_profile, 1); |
97 | 344 | variant_direct_leaf_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "VariantDirectLeafRows", |
98 | 344 | TUnit::UNIT, parquet_profile, 1); |
99 | 344 | variant_direct_leaf_path_misses = ADD_CHILD_COUNTER_WITH_LEVEL( |
100 | 344 | profile, "VariantDirectLeafPathMisses", TUnit::UNIT, parquet_profile, 1); |
101 | 344 | variant_direct_leaf_residual_fallbacks = ADD_CHILD_COUNTER_WITH_LEVEL( |
102 | 344 | profile, "VariantDirectLeafResidualFallbacks", TUnit::UNIT, parquet_profile, 1); |
103 | 344 | variant_direct_leaf_unsupported_fallbacks = ADD_CHILD_COUNTER_WITH_LEVEL( |
104 | 344 | profile, "VariantDirectLeafUnsupportedFallbacks", TUnit::UNIT, parquet_profile, 1); |
105 | 344 | hybrid_selection_batches = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "HybridSelectionBatches", |
106 | 344 | TUnit::UNIT, parquet_profile, 1); |
107 | 344 | hybrid_selection_ranges = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "HybridSelectionRanges", |
108 | 344 | TUnit::UNIT, parquet_profile, 1); |
109 | 344 | hybrid_selection_null_fallback_batches = ADD_CHILD_COUNTER_WITH_LEVEL( |
110 | 344 | profile, "HybridSelectionNullFallbackBatches", TUnit::UNIT, parquet_profile, 1); |
111 | 344 | native_read_calls = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NativeReadCalls", TUnit::UNIT, |
112 | 344 | parquet_profile, 1); |
113 | 344 | native_page_fragments = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NativePageFragments", |
114 | 344 | TUnit::UNIT, parquet_profile, 1); |
115 | 344 | page_crossing_batches = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageCrossingBatches", |
116 | 344 | TUnit::UNIT, parquet_profile, 1); |
117 | 344 | nested_batches = |
118 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NestedBatches", TUnit::UNIT, parquet_profile, 1); |
119 | 344 | lazy_read_filtered_rows = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FilteredRowsByLazyRead", |
120 | 344 | TUnit::UNIT, parquet_profile, 1); |
121 | | // Format-specific counters stay below ParquetReader so subtree consumers cannot silently |
122 | | // attribute them to a different file format initialized on the same RuntimeProfile. |
123 | 344 | filtered_bytes = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FilteredBytes", TUnit::BYTES, |
124 | 344 | parquet_profile, 1); |
125 | 344 | raw_rows_read = |
126 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RawRowsRead", TUnit::UNIT, parquet_profile, 1); |
127 | 344 | column_read_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "ColumnReadTime", parquet_profile, 1); |
128 | 344 | parse_meta_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "ParseMetaTime", parquet_profile, 1); |
129 | 344 | parse_footer_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "ParseFooterTime", parquet_profile, 1); |
130 | 344 | file_reader_create_time = |
131 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "FileReaderCreateTime", parquet_profile, 1); |
132 | 344 | open_file_num = |
133 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FileNum", TUnit::UNIT, parquet_profile, 1); |
134 | 344 | page_index_read_calls = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageIndexReadCalls", TUnit::UNIT, |
135 | 344 | parquet_profile, 1); |
136 | 344 | page_index_filter_time = |
137 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PageIndexFilterTime", parquet_profile, 1); |
138 | 344 | read_page_index_time = |
139 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PageIndexReadTime", parquet_profile, 1); |
140 | 344 | parse_page_index_time = |
141 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PageIndexParseTime", parquet_profile, 1); |
142 | 344 | expr_zonemap_unusable = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "ExprZoneMapUnusableEvals", |
143 | 344 | TUnit::UNIT, parquet_profile, 1); |
144 | 344 | in_zonemap_point_check = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "InZoneMapPointCheckCount", |
145 | 344 | TUnit::UNIT, parquet_profile, 1); |
146 | 344 | in_zonemap_range_only = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "InZoneMapRangeOnlyCount", |
147 | 344 | TUnit::UNIT, parquet_profile, 1); |
148 | 344 | row_group_filter_time = |
149 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "RowGroupFilterTime", parquet_profile, 1); |
150 | 344 | file_footer_read_calls = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FileFooterReadCalls", |
151 | 344 | TUnit::UNIT, parquet_profile, 1); |
152 | 344 | file_footer_hit_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "FileFooterHitCache", TUnit::UNIT, |
153 | 344 | parquet_profile, 1); |
154 | 344 | decompress_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "DecompressTime", parquet_profile, 1); |
155 | 344 | decompress_cnt = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "DecompressCount", TUnit::UNIT, |
156 | 344 | parquet_profile, 1); |
157 | 344 | page_read_counter = |
158 | 344 | ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageReadCount", TUnit::UNIT, parquet_profile, 1); |
159 | 344 | page_cache_write_counter = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageCacheWriteCount", |
160 | 344 | TUnit::UNIT, parquet_profile, 1); |
161 | 344 | page_cache_compressed_write_counter = ADD_CHILD_COUNTER_WITH_LEVEL( |
162 | 344 | profile, "PageCacheCompressedWriteCount", TUnit::UNIT, parquet_profile, 1); |
163 | 344 | page_cache_decompressed_write_counter = ADD_CHILD_COUNTER_WITH_LEVEL( |
164 | 344 | profile, "PageCacheDecompressedWriteCount", TUnit::UNIT, parquet_profile, 1); |
165 | 344 | page_cache_hit_counter = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageCacheHitCount", TUnit::UNIT, |
166 | 344 | parquet_profile, 1); |
167 | 344 | page_cache_missing_counter = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PageCacheMissingCount", |
168 | 344 | TUnit::UNIT, parquet_profile, 1); |
169 | 344 | page_cache_compressed_hit_counter = ADD_CHILD_COUNTER_WITH_LEVEL( |
170 | 344 | profile, "PageCacheCompressedHitCount", TUnit::UNIT, parquet_profile, 1); |
171 | 344 | page_cache_decompressed_hit_counter = ADD_CHILD_COUNTER_WITH_LEVEL( |
172 | 344 | profile, "PageCacheDecompressedHitCount", TUnit::UNIT, parquet_profile, 1); |
173 | 344 | decode_header_time = |
174 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PageHeaderDecodeTime", parquet_profile, 1); |
175 | 344 | read_page_header_time = |
176 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PageHeaderReadTime", parquet_profile, 1); |
177 | 344 | decode_value_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "DecodeValueTime", parquet_profile, 1); |
178 | 344 | decode_dict_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "DecodeDictTime", parquet_profile, 1); |
179 | 344 | decode_level_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, "DecodeLevelTime", parquet_profile, 1); |
180 | 344 | decode_null_map_time = |
181 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "DecodeNullMapTime", parquet_profile, 1); |
182 | 344 | skip_page_header_num = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SkipPageHeaderNum", TUnit::UNIT, |
183 | 344 | parquet_profile, 1); |
184 | 344 | parse_page_header_num = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "ParsePageHeaderNum", TUnit::UNIT, |
185 | 344 | parquet_profile, 1); |
186 | 344 | predicate_filter_time = |
187 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PredicateFilterTime", parquet_profile, 1); |
188 | 344 | predicate_compaction_time = |
189 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "PredicateCompactionTime", parquet_profile, 1); |
190 | 344 | predicate_compaction_bytes = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PredicateCompactionBytes", |
191 | 344 | TUnit::BYTES, parquet_profile, 1); |
192 | 344 | predicate_compaction_count = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PredicateCompactionCount", |
193 | 344 | TUnit::UNIT, parquet_profile, 1); |
194 | 344 | predicate_alignment_columns = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PredicateAlignmentColumns", |
195 | 344 | TUnit::UNIT, parquet_profile, 1); |
196 | 344 | fixed_width_predicate_direct_batches = ADD_CHILD_COUNTER_WITH_LEVEL( |
197 | 344 | profile, "FixedWidthPredicateDirectBatches", TUnit::UNIT, parquet_profile, 1); |
198 | 344 | fixed_width_predicate_direct_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
199 | 344 | profile, "FixedWidthPredicateDirectRows", TUnit::UNIT, parquet_profile, 1); |
200 | 344 | raw_value_predicate_direct_batches = ADD_CHILD_COUNTER_WITH_LEVEL( |
201 | 344 | profile, "RawValuePredicateDirectBatches", TUnit::UNIT, parquet_profile, 1); |
202 | 344 | raw_value_predicate_direct_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
203 | 344 | profile, "RawValuePredicateDirectRows", TUnit::UNIT, parquet_profile, 1); |
204 | 344 | typed_runtime_filter_direct_batches = ADD_CHILD_COUNTER_WITH_LEVEL( |
205 | 344 | profile, "TypedRuntimeFilterDirectBatches", TUnit::UNIT, parquet_profile, 1); |
206 | 344 | typed_runtime_filter_direct_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
207 | 344 | profile, "TypedRuntimeFilterDirectRows", TUnit::UNIT, parquet_profile, 1); |
208 | 344 | dictionary_predicate_direct_batches = ADD_CHILD_COUNTER_WITH_LEVEL( |
209 | 344 | profile, "DictionaryPredicateDirectBatches", TUnit::UNIT, parquet_profile, 1); |
210 | 344 | dictionary_predicate_direct_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
211 | 344 | profile, "DictionaryPredicateDirectRows", TUnit::UNIT, parquet_profile, 1); |
212 | 344 | dictionary_predicate_projected_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
213 | 344 | profile, "DictionaryPredicateProjectedRows", TUnit::UNIT, parquet_profile, 1); |
214 | 344 | dictionary_predicate_fused_projected_rows = ADD_CHILD_COUNTER_WITH_LEVEL( |
215 | 344 | profile, "DictionaryPredicateFusedProjectedRows", TUnit::UNIT, parquet_profile, 1); |
216 | 344 | dict_filter_rewrite_time = |
217 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "DictFilterRewriteTime", parquet_profile, 1); |
218 | 344 | dict_filter_expr_rewrite_time = |
219 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "DictFilterExprRewriteTime", parquet_profile, 1); |
220 | 344 | dict_filter_read_dict_time = |
221 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "DictFilterReadDictTime", parquet_profile, 1); |
222 | 344 | dict_filter_build_time = |
223 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "DictFilterBuildTime", parquet_profile, 1); |
224 | 344 | dict_filter_candidate_columns = ADD_CHILD_COUNTER_WITH_LEVEL( |
225 | 344 | profile, "DictFilterCandidateColumns", TUnit::UNIT, parquet_profile, 1); |
226 | 344 | dict_filter_columns = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "DictFilterColumns", TUnit::UNIT, |
227 | 344 | parquet_profile, 1); |
228 | 344 | dict_filter_typed_compare_columns = ADD_CHILD_COUNTER_WITH_LEVEL( |
229 | 344 | profile, "DictFilterTypedCompareColumns", TUnit::UNIT, parquet_profile, 1); |
230 | 344 | dict_filter_string_compare_columns = ADD_CHILD_COUNTER_WITH_LEVEL( |
231 | 344 | profile, "DictFilterStringCompareColumns", TUnit::UNIT, parquet_profile, 1); |
232 | 344 | dict_filter_vectorized_runtime_filter_columns = ADD_CHILD_COUNTER_WITH_LEVEL( |
233 | 344 | profile, "DictFilterVectorizedRuntimeFilterColumns", TUnit::UNIT, parquet_profile, 1); |
234 | 344 | dict_filter_unsupported_columns = ADD_CHILD_COUNTER_WITH_LEVEL( |
235 | 344 | profile, "DictFilterUnsupportedColumns", TUnit::UNIT, parquet_profile, 1); |
236 | 344 | dict_filter_read_failures = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "DictFilterReadFailures", |
237 | 344 | TUnit::UNIT, parquet_profile, 1); |
238 | 344 | rows_filtered_by_dict_filter = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "RowsFilteredByDictFilter", |
239 | 344 | TUnit::UNIT, parquet_profile, 1); |
240 | 344 | bloom_filter_read_time = |
241 | 344 | ADD_CHILD_TIMER_WITH_LEVEL(profile, "BloomFilterReadTime", parquet_profile, 1); |
242 | 344 | } |
243 | | |
244 | 166 | void ParquetProfile::update_pruning_stats(const ParquetPruningStats& pruning_stats) const { |
245 | 166 | COUNTER_UPDATE(filtered_row_groups, |
246 | 166 | pruning_stats.total_row_groups - pruning_stats.selected_row_groups); |
247 | 166 | COUNTER_UPDATE(filtered_row_groups_by_min_max, pruning_stats.filtered_row_groups_by_statistics); |
248 | 166 | COUNTER_UPDATE(filtered_row_groups_by_dictionary, |
249 | 166 | pruning_stats.filtered_row_groups_by_dictionary); |
250 | 166 | COUNTER_UPDATE(filtered_row_groups_by_bloom_filter, |
251 | 166 | pruning_stats.filtered_row_groups_by_bloom_filter); |
252 | 166 | COUNTER_UPDATE(filtered_row_groups_by_page_index, |
253 | 166 | pruning_stats.filtered_row_groups_by_page_index); |
254 | 166 | COUNTER_UPDATE(to_read_row_groups, pruning_stats.selected_row_groups); |
255 | 166 | COUNTER_UPDATE(total_row_groups, pruning_stats.total_row_groups); |
256 | 166 | COUNTER_UPDATE(selected_row_ranges, pruning_stats.selected_row_ranges); |
257 | 166 | COUNTER_UPDATE(filtered_group_rows, pruning_stats.filtered_group_rows); |
258 | 166 | COUNTER_UPDATE(filtered_bytes, pruning_stats.filtered_bytes); |
259 | 166 | COUNTER_UPDATE(filtered_page_rows, pruning_stats.filtered_page_rows); |
260 | 166 | COUNTER_UPDATE(page_index_read_calls, pruning_stats.page_index_read_calls); |
261 | 166 | COUNTER_UPDATE(bloom_filter_read_time, pruning_stats.bloom_filter_read_time); |
262 | 166 | COUNTER_UPDATE(row_group_filter_time, pruning_stats.row_group_filter_time); |
263 | 166 | COUNTER_UPDATE(page_index_filter_time, pruning_stats.page_index_filter_time); |
264 | 166 | COUNTER_UPDATE(read_page_index_time, pruning_stats.read_page_index_time); |
265 | 166 | COUNTER_UPDATE(parse_page_index_time, pruning_stats.parse_page_index_time); |
266 | 166 | COUNTER_UPDATE(expr_zonemap_unusable, pruning_stats.expr_zonemap_unusable_evals); |
267 | 166 | COUNTER_UPDATE(in_zonemap_point_check, pruning_stats.in_zonemap_point_check_count); |
268 | 166 | COUNTER_UPDATE(in_zonemap_range_only, pruning_stats.in_zonemap_range_only_count); |
269 | 166 | } |
270 | | |
271 | | void ParquetProfile::update_deferred_pruning_stats(const ParquetPruningStats& pruning_stats, |
272 | 185 | bool selected) const { |
273 | 185 | const int64_t filtered = selected ? 0 : 1; |
274 | 185 | COUNTER_UPDATE(filtered_row_groups, filtered); |
275 | 185 | COUNTER_UPDATE(filtered_row_groups_by_min_max, pruning_stats.filtered_row_groups_by_statistics); |
276 | 185 | COUNTER_UPDATE(filtered_row_groups_by_dictionary, |
277 | 185 | pruning_stats.filtered_row_groups_by_dictionary); |
278 | 185 | COUNTER_UPDATE(filtered_row_groups_by_bloom_filter, |
279 | 185 | pruning_stats.filtered_row_groups_by_bloom_filter); |
280 | 185 | COUNTER_UPDATE(filtered_row_groups_by_page_index, |
281 | 185 | pruning_stats.filtered_row_groups_by_page_index); |
282 | | // Initial footer planning counts every surviving candidate as readable. Lazy probes correct |
283 | | // that estimate only when a later dictionary, Bloom, or page-index check removes the group. |
284 | 185 | COUNTER_UPDATE(to_read_row_groups, -filtered); |
285 | 185 | COUNTER_UPDATE(selected_row_ranges, pruning_stats.selected_row_ranges); |
286 | 185 | COUNTER_UPDATE(filtered_group_rows, pruning_stats.filtered_group_rows); |
287 | 185 | COUNTER_UPDATE(filtered_bytes, pruning_stats.filtered_bytes); |
288 | 185 | COUNTER_UPDATE(filtered_page_rows, pruning_stats.filtered_page_rows); |
289 | 185 | COUNTER_UPDATE(page_index_read_calls, pruning_stats.page_index_read_calls); |
290 | 185 | COUNTER_UPDATE(bloom_filter_read_time, pruning_stats.bloom_filter_read_time); |
291 | 185 | COUNTER_UPDATE(row_group_filter_time, pruning_stats.row_group_filter_time); |
292 | 185 | COUNTER_UPDATE(page_index_filter_time, pruning_stats.page_index_filter_time); |
293 | 185 | COUNTER_UPDATE(read_page_index_time, pruning_stats.read_page_index_time); |
294 | 185 | COUNTER_UPDATE(parse_page_index_time, pruning_stats.parse_page_index_time); |
295 | 185 | COUNTER_UPDATE(expr_zonemap_unusable, pruning_stats.expr_zonemap_unusable_evals); |
296 | 185 | COUNTER_UPDATE(in_zonemap_point_check, pruning_stats.in_zonemap_point_check_count); |
297 | 185 | COUNTER_UPDATE(in_zonemap_range_only, pruning_stats.in_zonemap_range_only_count); |
298 | 185 | } |
299 | | |
300 | 264 | ParquetPageSkipProfile ParquetProfile::page_skip_profile() const { |
301 | 264 | return { |
302 | 264 | .skipped_pages = pages_skipped_by_data_page_filter, |
303 | 264 | .skipped_bytes = data_page_filter_skip_bytes, |
304 | 264 | }; |
305 | 264 | } |
306 | | |
307 | 563 | ParquetColumnReaderProfile ParquetProfile::column_reader_profile() const { |
308 | 563 | return { |
309 | 563 | .reader_read_rows = reader_read_rows, |
310 | 563 | .reader_skip_rows = reader_skip_rows, |
311 | 563 | .reader_select_rows = reader_select_rows, |
312 | 563 | .level_only_read_time = level_only_read_time, |
313 | 563 | .level_only_skip_time = level_only_skip_time, |
314 | 563 | .materialization_time = materialization_time, |
315 | 563 | .variant_reconstruction_time = variant_reconstruction_time, |
316 | 563 | .variant_reconstructed_rows = variant_reconstructed_rows, |
317 | 563 | .variant_direct_leaf_rows = variant_direct_leaf_rows, |
318 | 563 | .variant_direct_leaf_path_misses = variant_direct_leaf_path_misses, |
319 | 563 | .variant_direct_leaf_residual_fallbacks = variant_direct_leaf_residual_fallbacks, |
320 | 563 | .variant_direct_leaf_unsupported_fallbacks = variant_direct_leaf_unsupported_fallbacks, |
321 | 563 | .hybrid_selection_batches = hybrid_selection_batches, |
322 | 563 | .hybrid_selection_ranges = hybrid_selection_ranges, |
323 | 563 | .hybrid_selection_null_fallback_batches = hybrid_selection_null_fallback_batches, |
324 | 563 | .dictionary_predicate_fused_projected_rows = dictionary_predicate_fused_projected_rows, |
325 | 563 | .decompress_time = decompress_time, |
326 | 563 | .decompress_count = decompress_cnt, |
327 | 563 | .decode_header_time = decode_header_time, |
328 | 563 | .decode_value_time = decode_value_time, |
329 | 563 | .decode_dictionary_time = decode_dict_time, |
330 | 563 | .decode_level_time = decode_level_time, |
331 | 563 | .decode_null_map_time = decode_null_map_time, |
332 | 563 | .page_index_read_calls = page_index_read_calls, |
333 | 563 | .skip_page_header_count = skip_page_header_num, |
334 | 563 | .parse_page_header_count = parse_page_header_num, |
335 | 563 | .read_page_header_time = read_page_header_time, |
336 | 563 | .page_read_count = page_read_counter, |
337 | 563 | .page_cache_write_count = page_cache_write_counter, |
338 | 563 | .page_cache_compressed_write_count = page_cache_compressed_write_counter, |
339 | 563 | .page_cache_decompressed_write_count = page_cache_decompressed_write_counter, |
340 | 563 | .page_cache_hit_count = page_cache_hit_counter, |
341 | 563 | .page_cache_miss_count = page_cache_missing_counter, |
342 | 563 | .page_cache_compressed_hit_count = page_cache_compressed_hit_counter, |
343 | 563 | .page_cache_decompressed_hit_count = page_cache_decompressed_hit_counter, |
344 | 563 | .native_read_calls = native_read_calls, |
345 | 563 | .native_page_fragments = native_page_fragments, |
346 | 563 | .page_crossing_batches = page_crossing_batches, |
347 | 563 | .nested_batches = nested_batches, |
348 | 563 | }; |
349 | 563 | } |
350 | | |
351 | 271 | ParquetScanProfile ParquetProfile::scan_profile() const { |
352 | 271 | return { |
353 | 271 | .raw_rows_read = raw_rows_read, |
354 | 271 | .selected_rows = selected_rows, |
355 | 271 | .rows_filtered_by_conjunct = rows_filtered_by_conjunct, |
356 | 271 | .lazy_read_filtered_rows = lazy_read_filtered_rows, |
357 | 271 | .total_batches = total_batches, |
358 | 271 | .dense_batches = dense_batches, |
359 | 271 | .selected_batches = selected_batches, |
360 | 271 | .empty_selection_batches = empty_selection_batches, |
361 | 271 | .range_gap_skipped_rows = range_gap_skipped_rows, |
362 | 271 | .column_read_time = column_read_time, |
363 | 271 | .predicate_filter_time = predicate_filter_time, |
364 | 271 | .predicate_compaction_time = predicate_compaction_time, |
365 | 271 | .predicate_compaction_bytes = predicate_compaction_bytes, |
366 | 271 | .predicate_compaction_count = predicate_compaction_count, |
367 | 271 | .predicate_alignment_columns = predicate_alignment_columns, |
368 | 271 | .fixed_width_predicate_direct_batches = fixed_width_predicate_direct_batches, |
369 | 271 | .fixed_width_predicate_direct_rows = fixed_width_predicate_direct_rows, |
370 | 271 | .raw_value_predicate_direct_batches = raw_value_predicate_direct_batches, |
371 | 271 | .raw_value_predicate_direct_rows = raw_value_predicate_direct_rows, |
372 | 271 | .typed_runtime_filter_direct_batches = typed_runtime_filter_direct_batches, |
373 | 271 | .typed_runtime_filter_direct_rows = typed_runtime_filter_direct_rows, |
374 | 271 | .dictionary_predicate_direct_batches = dictionary_predicate_direct_batches, |
375 | 271 | .dictionary_predicate_direct_rows = dictionary_predicate_direct_rows, |
376 | 271 | .dictionary_predicate_projected_rows = dictionary_predicate_projected_rows, |
377 | 271 | .dict_filter_rewrite_time = dict_filter_rewrite_time, |
378 | 271 | .dict_filter_expr_rewrite_time = dict_filter_expr_rewrite_time, |
379 | 271 | .dict_filter_read_dict_time = dict_filter_read_dict_time, |
380 | 271 | .dict_filter_build_time = dict_filter_build_time, |
381 | 271 | .dict_filter_candidate_columns = dict_filter_candidate_columns, |
382 | 271 | .dict_filter_columns = dict_filter_columns, |
383 | 271 | .dict_filter_typed_compare_columns = dict_filter_typed_compare_columns, |
384 | 271 | .dict_filter_string_compare_columns = dict_filter_string_compare_columns, |
385 | 271 | .dict_filter_vectorized_runtime_filter_columns = |
386 | 271 | dict_filter_vectorized_runtime_filter_columns, |
387 | 271 | .dict_filter_unsupported_columns = dict_filter_unsupported_columns, |
388 | 271 | .dict_filter_read_failures = dict_filter_read_failures, |
389 | 271 | .rows_filtered_by_dict_filter = rows_filtered_by_dict_filter, |
390 | 271 | .column_reader_profile = column_reader_profile(), |
391 | 271 | }; |
392 | 271 | } |
393 | | |
394 | | } // namespace doris::format::parquet |