Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cg-cognition committed Dec 11, 2024
1 parent e7b01b2 commit 6be446d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
15 changes: 3 additions & 12 deletions kernel/src/scan/data_skipping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ impl DataSkippingFilter {
STATS_EXPR.clone(),
DataType::STRING,
)
.map_err(|e| {
warn!("Failed to create stats selector evaluator: {}", e);
e
})
.inspect_err(|e| warn!("Failed to create stats selector evaluator: {}", e))
.ok()?;

let skipping_evaluator = engine
Expand All @@ -120,19 +117,13 @@ impl DataSkippingFilter {
Expr::struct_from([as_data_skipping_predicate(&predicate, false)?]),
PREDICATE_SCHEMA.clone(),
)
.map_err(|e| {
warn!("Failed to create skipping evaluator: {}", e);
e
})
.inspect_err(|e| warn!("Failed to create skipping evaluator: {}", e))
.ok()?;

let filter_evaluator = engine
.get_expression_handler()
.get_evaluator(stats_schema.clone(), FILTER_EXPR.clone(), DataType::BOOLEAN)
.map_err(|e| {
warn!("Failed to create filter evaluator: {}", e);
e
})
.inspect_err(|e| warn!("Failed to create filter evaluator: {}", e))
.ok()?;

Some(Self {
Expand Down
8 changes: 6 additions & 2 deletions kernel/src/scan/log_replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,16 @@ pub fn scan_action_iter(
SCAN_ROW_DATATYPE.clone(),
)?;

Ok(action_iter
let actions = action_iter
.map(move |action_res| {
let (batch, is_log_batch) = action_res?;
log_scanner.process_scan_batch(add_transform.as_ref(), batch.as_ref(), is_log_batch)
})
.filter(|res| res.as_ref().map_or(true, |(_, sv)| sv.contains(&true))))
.filter(|res: &Result<(Box<dyn EngineData>, Vec<bool>), Error>| {
res.as_ref().map_or(true, |(_, sv)| sv.contains(&true))
});

Ok(actions)
}

#[cfg(test)]
Expand Down

0 comments on commit 6be446d

Please sign in to comment.