Skip to content

Commit

Permalink
Address formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
OussamaSaoudi-db committed Sep 19, 2024
1 parent 3a6dd9b commit 8444538
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions kernel/src/engine/arrow_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,15 @@ use crate::{EngineData, ExpressionEvaluator, ExpressionHandler};
// TODO leverage scalars / Datum
//
pub fn expression_to_row_filter(predicate: Expression) -> RowFilter {
let arrow_predicate = ArrowPredicateFn::new(
ProjectionMask::all(),
move |batch| {
downcast_to_bool(
&evaluate_expression(&predicate, &batch, None)
.map_err(|err| ArrowError::ExternalError(Box::new(err)))?,
)
.map_err(|err| ArrowError::ExternalError(Box::new(err)))
.cloned()
},
);
RowFilter::new(vec![Box::new(arrow_predicate)])
let arrow_predicate = ArrowPredicateFn::new(ProjectionMask::all(), move |batch| {
downcast_to_bool(
&evaluate_expression(&predicate, &batch, None)
.map_err(|err| ArrowError::ExternalError(Box::new(err)))?,
)
.map_err(|err| ArrowError::ExternalError(Box::new(err)))
.cloned()
});
RowFilter::new(vec![Box::new(arrow_predicate)])
}

fn downcast_to_bool(arr: &dyn Array) -> DeltaResult<&BooleanArray> {
Expand Down

0 comments on commit 8444538

Please sign in to comment.