Skip to content

Commit e9493ea

Browse files
committed
Refresh parquet benchmark filter descriptions
1 parent 3b65fc4 commit e9493ea

2 files changed

Lines changed: 140 additions & 17 deletions

File tree

parquet/benches/arrow_reader_materialization_policy.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn append_utf8_view_value(builder: &mut StringViewBuilder, value: &str) {
133133
/// * Number of RowSelections = 14054784
134134
/// * Average run length of each RowSelection: 99997497 / 14054784 = 7.114
135135
///
136-
/// The properties of this array are:
136+
/// A 100K-row reference generated by this shape has:
137137
/// * Selectivity is: 15144 / 100000 = 0.15144
138138
/// * Number of RowSelections = 12904
139139
/// * Average run length of each RowSelection: 100000 / 12904 = 7.75
@@ -171,7 +171,8 @@ fn create_ts_array(size: usize) -> ArrayRef {
171171
Arc::new(TimestampMillisecondArray::from(values)) as ArrayRef
172172
}
173173

174-
/// Creates a RecordBatch with 100K rows and 4 columns: int64, float64, utf8View, and ts.
174+
/// Creates a RecordBatch with `size` rows and 4 columns: int64, float64,
175+
/// utf8View, and ts.
175176
pub(crate) fn create_record_batch(size: usize) -> RecordBatch {
176177
let fields = vec![
177178
Field::new("int64", DataType::Int64, false),
@@ -315,9 +316,9 @@ pub(crate) enum FilterType {
315316
/// │ │ │ │
316317
/// └───────────────┘ └───────────────┘
317318
/// ```
318-
/// (1000 RowSelection of 10 rows each)
319+
/// (fragmented, approx 5K selected rows in 500K)
319320
SelectiveUnclustered,
320-
/// moderately selective (10%) clustered filter
321+
/// moderately selective (~9%) unclustered filter
321322
/// ```text
322323
/// ┌───────────────┐ ┌───────────────┐
323324
/// │ ... │ │ │
@@ -331,7 +332,7 @@ pub(crate) enum FilterType {
331332
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
332333
/// └───────────────┘ └───────────────┘
333334
/// ```
334-
/// (10 RowSelections of 10,000 rows each)
335+
/// (fragmented, approx 45K selected rows in 500K)
335336
ModeratelySelectiveUnclustered,
336337
/// unselective (99%) unclustered filter
337338
/// ```text
@@ -348,23 +349,23 @@ pub(crate) enum FilterType {
348349
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
349350
/// └───────────────┘ └───────────────┘
350351
/// ```
351-
/// (99,000 RowSelections of 10 rows each)
352+
/// (fragmented, approx 495K selected rows in 500K)
352353
UnselectiveUnclustered,
353354
/// unselective (90%) clustered filter
354355
/// ```text
355356
/// ┌───────────────┐ ┌───────────────┐
357+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
358+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
359+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
360+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
361+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
362+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
363+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
364+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ ... │
356365
/// │ │ │ │
357-
/// │ │ │ │
358-
/// │ │ │ ... │
359-
/// │ │ │ │
360-
/// │ ... │ │ │
361-
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
362-
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
363-
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
364-
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
365366
/// └───────────────┘ └───────────────┘
366367
/// ```
367-
/// (99 RowSelection of 10,000 rows each)
368+
/// (50 selected runs of 9K rows each in 500K)
368369
UnselectiveClustered,
369370
/// `utf8View <> ''` modeling [ClickBench] [Q21-Q27]
370371
///

parquet/benches/arrow_reader_row_filter.rs

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn append_utf8_view_value(builder: &mut StringViewBuilder, value: &str) {
135135
/// * Number of RowSelections = 14054784
136136
/// * Average run length of each RowSelection: 99997497 / 14054784 = 7.114
137137
///
138-
/// The properties of this array are:
138+
/// A 100K-row reference generated by this shape has:
139139
/// * Selectivity is: 15144 / 100000 = 0.15144
140140
/// * Number of RowSelections = 12904
141141
/// * Average run length of each RowSelection: 100000 / 12904 = 7.75
@@ -173,7 +173,8 @@ fn create_ts_array(size: usize) -> ArrayRef {
173173
Arc::new(TimestampMillisecondArray::from(values)) as ArrayRef
174174
}
175175

176-
/// Creates a RecordBatch with 100K rows and 4 columns: int64, float64, utf8View, and ts.
176+
/// Creates a RecordBatch with `size` rows and 4 columns: int64, float64,
177+
/// utf8View, and ts.
177178
pub(crate) fn create_record_batch(size: usize) -> RecordBatch {
178179
let fields = vec![
179180
Field::new("int64", DataType::Int64, false),
@@ -319,13 +320,134 @@ impl std::fmt::Display for AsyncStrategy {
319320
/// The variants correspond to the different filter patterns.
320321
#[derive(Clone, Copy, Debug)]
321322
pub(crate) enum FilterType {
323+
/// point lookup: selects a single row in 500K.
324+
/// ```text
325+
/// ┌───────────────┐ ┌───────────────┐
326+
/// │ │ │ │
327+
/// │ │ │ ... │
328+
/// │ │ │ │
329+
/// │ │ │ │
330+
/// │ ... │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
331+
/// │ │ │ │
332+
/// │ │ │ ... │
333+
/// │ │ │ │
334+
/// │ │ │ │
335+
/// └───────────────┘ └───────────────┘
336+
/// ```
322337
PointLookup,
338+
/// selective (1%) unclustered filter: approx 5K selected rows in 500K.
339+
/// ```text
340+
/// ┌───────────────┐ ┌───────────────┐
341+
/// │ ... │ │ │
342+
/// │ │ │ │
343+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
344+
/// │ │ │ ... │
345+
/// │ │ │ │
346+
/// │ │ │ │
347+
/// │ ... │ │ │
348+
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
349+
/// │ │ │ │
350+
/// └───────────────┘ └───────────────┘
351+
/// ```
323352
SelectiveUnclustered,
353+
/// moderately selective (10%) clustered filter: 50 selected runs of 1K
354+
/// rows each in 500K.
355+
/// ```text
356+
/// ┌───────────────┐ ┌───────────────┐
357+
/// │ │ │ │
358+
/// │ │ │ │
359+
/// │ ... │ │ ... │
360+
/// │ │ │ │
361+
/// │ │ │ │
362+
/// │ │ │ │
363+
/// │ │ │ │
364+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
365+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
366+
/// └───────────────┘ └───────────────┘
367+
/// ```
324368
ModeratelySelectiveClustered,
369+
/// moderately selective (~9%) unclustered filter: approx 45K selected
370+
/// rows in 500K.
371+
/// ```text
372+
/// ┌───────────────┐ ┌───────────────┐
373+
/// │ ... │ │ │
374+
/// │ │ │ │
375+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
376+
/// │ │ │ │
377+
/// │ │ │ │
378+
/// │ │ │ ... │
379+
/// │ ... │ │ │
380+
/// │ │ │ │
381+
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
382+
/// └───────────────┘ └───────────────┘
383+
/// ```
325384
ModeratelySelectiveUnclustered,
385+
/// unselective (99%) unclustered filter: approx 495K selected rows in
386+
/// 500K.
387+
/// ```text
388+
/// ┌───────────────┐ ┌───────────────┐
389+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
390+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
391+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
392+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
393+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
394+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
395+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
396+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
397+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
398+
/// └───────────────┘ └───────────────┘
399+
/// ```
326400
UnselectiveUnclustered,
401+
/// unselective (90%) clustered filter: 50 selected runs of 9K rows each
402+
/// in 500K.
403+
/// ```text
404+
/// ┌───────────────┐ ┌───────────────┐
405+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
406+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
407+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
408+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
409+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
410+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
411+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
412+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ ... │
413+
/// │ │ │ │
414+
/// └───────────────┘ └───────────────┘
415+
/// ```
327416
UnselectiveClustered,
417+
/// composite sparse filter: `SelectiveUnclustered` AND
418+
/// `ModeratelySelectiveClustered`, approx 0.1% selected rows in 500K.
419+
/// ```text
420+
/// ┌───────────────┐ ┌───────────────┐
421+
/// │ │ │ │
422+
/// │ │ │ ... │
423+
/// │ │ │ │
424+
/// │ │ │ │
425+
/// │ ... │ │ │
426+
/// │ │ │ │
427+
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
428+
/// │ │ │ │
429+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
430+
/// └───────────────┘ └───────────────┘
431+
/// ```
328432
Composite,
433+
/// `utf8View <> ''` modeling [ClickBench] [Q21-Q27] with fragmented
434+
/// short string runs and sentinel values every 1K rows.
435+
/// ```text
436+
/// ┌───────────────┐ ┌───────────────┐
437+
/// │ │ │ │
438+
/// │ ... │ │ ... │
439+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
440+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
441+
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
442+
/// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
443+
/// │ ... │ │ ... │
444+
/// │ │ │ │
445+
/// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
446+
/// └───────────────┘ └───────────────┘
447+
/// ```
448+
///
449+
/// [ClickBench]: https://github.com/ClickHouse/ClickBench
450+
/// [Q21-Q27]: https://github.com/apache/datafusion/blob/b7177234e65cbbb2dcc04c252f6acd80bb026362/benchmarks/queries/clickbench/queries.sql#L22-L28
329451
Utf8ViewNonEmpty,
330452
}
331453

0 commit comments

Comments
 (0)