refactor: address PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
pull/24376/head
Edd Robinson 2021-02-05 13:06:35 +00:00
parent 48b29a9c72
commit f0748cc379
6 changed files with 9 additions and 13 deletions

View File

@ -258,7 +258,7 @@ impl Chunk {
}
/// Returns the distinct set of column names that contain data matching the
/// provided optional predicate.
/// provided predicate, which may be empty.
///
/// `dst` is a buffer that will be populated with results. `column_names` is
/// smart enough to short-circuit processing on row groups when it

View File

@ -307,11 +307,7 @@ impl Bool {
/// Returns true if the column contains any non-null values at the rows
/// provided.
pub fn has_non_null_value(&self, row_ids: &[u32]) -> bool {
if !self.contains_null() {
return true;
}
row_ids.iter().any(|id| !self.arr.is_null(*id as usize))
!self.contains_null() || row_ids.iter().any(|id| !self.arr.is_null(*id as usize))
}
}

View File

@ -670,7 +670,7 @@ impl Plain {
return true;
}
// If there are more than one dictionary entries then there is a non-null
// If there is more than one dictionary entry then there is a non-null
// value in the column.
self.entries.len() > 1
}

View File

@ -801,7 +801,7 @@ impl RLE {
return true;
}
// If there are any non-null rows then there will entries in the
// If there are any non-null rows then there are entries in the
// dictionary.
!self.entry_index.is_empty()
}

View File

@ -488,7 +488,7 @@ impl Database {
})?;
let chunk_data = partition.data.read().unwrap();
let mut filtered_chunks = vec![];
let mut filtered_chunks = Vec::with_capacity(chunk_ids.len());
for id in chunk_ids {
filtered_chunks.push(
chunk_data

View File

@ -923,10 +923,10 @@ impl RowGroup {
dst.aggregates.push(AggregateResults(aggregate_row)); // write the row
}
/// Given the optional predicate, determines a set of rows contained in this
/// row group that satisfy it. Any column that contains a non-null value at
/// any of these row positions is then included in the results, which are
/// added to `dst`.
/// Given the predicate (which may be empty), determine a set of rows
/// contained in this row group that satisfy it. Any column that contains a
/// non-null value at any of these row positions is then included in the
/// results, which are added to `dst`.
///
/// As an optimisation, the contents of `dst` are checked before execution
/// and any columns already existing in the set are not interrogated.