Skip to content

bug: Filter predicate is duplicated in TableScanBuilder and TableScan πŸ€¦πŸΌβ€β™‚οΈ Β #407

@sdd

Description

@sdd

Somehow, between my PR and @viirya's PR getting merged, we've ended up with the filter predicate being duplicated in the TableScanBuilder and the TableScan.

See predicates and filter:

predicates: Option<Predicate>,
snapshot_id: Option<i64>,
batch_size: Option<usize>,
case_sensitive: bool,
filter: Option<Predicate>,

/// Specifies a predicate to use as a filter
pub fn with_filter(mut self, predicate: Predicate) -> Self {
// calls rewrite_not to remove Not nodes, which must be absent
// when applying the manifest evaluator
self.filter = Some(predicate.rewrite_not());
self
}

/// Add a predicate to the scan. The scan will only return rows that match the predicate.
pub fn filter(mut self, predicate: Predicate) -> Self {
self.predicates = Some(predicate);
self
}

And here in TableScan, bound_predicates and filter:

bound_predicates: Option<BoundPredicate>,
schema: SchemaRef,
batch_size: Option<usize>,
case_sensitive: bool,
filter: Option<Arc<Predicate>>,

The predicate pushdown uses one of these but the file plan uses another, which caused a lot of confusion when I was trying to track down why my queries were misbehaving!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions