refactor: expose negated_predicate API for columns_names

pull/24376/head
Edd Robinson 2021-10-08 10:09:50 +01:00
parent e191210c5b
commit 96e05726ee
2 changed files with 12 additions and 2 deletions

View File

@ -286,6 +286,7 @@ impl Chunk {
pub fn column_names(
&self,
predicate: Predicate,
_negated_predicates: Vec<Predicate>,
only_columns: Selection<'_>,
dst: BTreeSet<String>,
) -> Result<BTreeSet<String>> {
@ -1251,7 +1252,12 @@ mod test {
.build();
let result = chunk
.column_names(Predicate::default(), Selection::All, BTreeSet::new())
.column_names(
Predicate::default(),
vec![],
Selection::All,
BTreeSet::new(),
)
.unwrap();
assert_eq!(
@ -1263,6 +1269,7 @@ mod test {
let result = chunk
.column_names(
Predicate::new(vec![BinaryExpr::from(("time", "=", 222222_i64))]),
vec![],
Selection::All,
BTreeSet::new(),
)
@ -1276,6 +1283,7 @@ mod test {
assert!(matches!(
chunk.column_names(
Predicate::new(vec![BinaryExpr::from(("time", "=", "not a number"))]),
vec![],
Selection::Some(&["region", "env"]),
BTreeSet::new()
),

View File

@ -426,9 +426,11 @@ impl QueryChunk for DbChunk {
};
self.access_recorder.record_access();
// TODO(edd): wire up delete predicates to be pushed down to
// the read buffer.
Ok(Some(
chunk
.column_names(rb_predicate, columns, BTreeSet::new())
.column_names(rb_predicate, vec![], columns, BTreeSet::new())
.context(ReadBufferChunkError {
chunk_id: self.id(),
})?,