Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vortex-layout/src/layouts/dict/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ impl DictReader {
// after applying the filter, so if the expression is fallible this might fail when it
// shouldn't.
// TODO(joe): fixme

// Check cache first with read-only lock
if let Some(fut) = self.values_evals.get(&expr) {
return fut.clone();
}

let session = self.session.clone();
self.values_evals
.entry(expr.clone())
Expand Down
9 changes: 8 additions & 1 deletion vortex-layout/src/layouts/row_idx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ impl RowIdxLayoutReader {
}

fn partition_expr(&self, expr: &Expression) -> Partitioning {
let key = ExactExpr(expr.clone());

// Check cache first with read-only lock.
if let Some(partitioning) = self.partition_cache.get(&key) {
return partitioning.clone();
}

self.partition_cache
.entry(ExactExpr(expr.clone()))
.entry(key)
.or_insert_with(|| {
// Partition the expression into row idx and child expressions.
let mut partitioned = partition(expr.clone(), self.dtype(), |expr| {
Expand Down
5 changes: 5 additions & 0 deletions vortex-layout/src/layouts/zoned/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ impl ZonedReader {

/// Returns a pruning mask where `true` means the chunk _can be pruned_.
fn pruning_mask_future(&self, expr: Expression) -> Option<SharedPruningResult> {
// Check cache first with read-only lock
if let Some(result) = self.pruning_result.get(&expr) {
return result.value().clone();
}

self.pruning_result
.entry(expr.clone())
.or_insert_with(|| match self.pruning_predicate(expr.clone()) {
Expand Down
Loading