Skip to content

Commit fc5bd79

Browse files
committed
Improve test + comments
1 parent dc8f54d commit fc5bd79

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

datafusion/core/tests/parquet/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ struct ContextWithParquet {
108108

109109
/// The output of running one of the test cases
110110
struct TestOutput {
111-
/// The input string
111+
/// The input query SQL
112112
sql: String,
113113
/// Execution metrics for the Parquet Scan
114114
parquet_metrics: MetricsSet,
115-
/// number of rows in results
115+
/// number of actual rows in results
116116
result_rows: usize,
117117
/// the contents of the input, as a string
118118
pretty_input: String,

datafusion/core/tests/parquet/row_group_pruning.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct RowGroupPruningTest {
3434
expected_files_pruned_by_statistics: Option<usize>,
3535
expected_row_group_matched_by_bloom_filter: Option<usize>,
3636
expected_row_group_pruned_by_bloom_filter: Option<usize>,
37-
expected_results: usize,
37+
expected_rows: usize,
3838
}
3939
impl RowGroupPruningTest {
4040
// Start building the test configuration
@@ -48,7 +48,7 @@ impl RowGroupPruningTest {
4848
expected_files_pruned_by_statistics: None,
4949
expected_row_group_matched_by_bloom_filter: None,
5050
expected_row_group_pruned_by_bloom_filter: None,
51-
expected_results: 0,
51+
expected_rows: 0,
5252
}
5353
}
5454

@@ -99,9 +99,9 @@ impl RowGroupPruningTest {
9999
self
100100
}
101101

102-
// Set the expected rows for the test
102+
/// Set the number of expected rows from the output of this test
103103
fn with_expected_rows(mut self, rows: usize) -> Self {
104-
self.expected_results = rows;
104+
self.expected_rows = rows;
105105
self
106106
}
107107

@@ -145,8 +145,10 @@ impl RowGroupPruningTest {
145145
);
146146
assert_eq!(
147147
output.result_rows,
148-
self.expected_results,
149-
"mismatched expected rows: {}",
148+
self.expected_rows,
149+
"Expected {} rows, got {}: {}",
150+
output.result_rows,
151+
self.expected_rows,
150152
output.description(),
151153
);
152154
}

0 commit comments

Comments
 (0)