-
Notifications
You must be signed in to change notification settings - Fork 120
feat!: Make expression and predicate evaluator constructors fallible #1452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Make expression and predicate evaluator constructors fallible #1452
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1452 +/- ##
==========================================
- Coverage 85.00% 84.97% -0.04%
==========================================
Files 120 120
Lines 31620 31641 +21
Branches 31620 31641 +21
==========================================
+ Hits 26879 26886 +7
+ Misses 3446 3445 -1
- Partials 1295 1310 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aecdadf to
9155ff7
Compare
9df0890 to
ad74958
Compare
scovich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, couple questions that probably don't block merge
kernel/src/scan/data_skipping.rs
Outdated
| .map_err(|e| error!("Failed to create select stats evaluator: {e}")) | ||
| .ok()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... this turns Result<T, Error> into Result<T, ()> and then returns None in case of Result::Err? That took a minute to grok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change these to inspect error which makes the intent clearer I guess
| .new_predicate_evaluator(stats_schema.clone(), FILTER_PRED.clone()) | ||
| .ok()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not log the error! here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
ad74958 to
da506b3
Compare
This PR refactors the `new_expression_evaluator` and `new_predicate_evaluator` methods in the `EvaluationHandler` trait to return `DeltaResult` instead of being infallible. This is a breaking API change that enables: - Better error reporting at evaluator construction time rather than evaluation - Early validation of expression/predicate compatibility with input schemas - More idiomatic Rust error handling patterns **Changes:** - Updated `EvaluationHandler` trait signatures to return `DeltaResult<Arc<dyn Evaluator>>` - Updated `ArrowEvaluationHandler` implementation to wrap returns in `Ok(...)` - Made `ScanLogReplayProcessor::new` fallible - Updated `scan_action_iter` to return `DeltaResult<impl Iterator<...>>` - Updated 12 callsites across the codebase to propagate errors with `?` operator - Updated FFI layer to handle errors through ExternResult - All 630 existing kernel tests pass - All 18 FFI tests pass - Verified compilation with `cargo check --all-features` - No functional changes - purely refactoring error handling patterns
da506b3 to
d64cee7
Compare
…elta-io#1452) This PR refactors the `new_expression_evaluator` and `new_predicate_evaluator` methods in the `EvaluationHandler` trait to return `DeltaResult` instead of being infallible. Addresses delta-io#566. ## What changes are proposed in this pull request? This is a breaking API change that enables: - Better error reporting at evaluator construction time rather than evaluation - Early validation of expression/predicate compatibility with input schemas - More idiomatic Rust error handling patterns ### This PR affects the following public APIs `new_expression_evaluator` and `new_predicate_evaluator` in `EvaluationHandler` **Changes:** - Updated `EvaluationHandler` trait signatures to return `DeltaResult<Arc<dyn Evaluator>>` - Updated `ArrowEvaluationHandler` implementation to wrap returns in `Ok(...)` - Made `ScanLogReplayProcessor::new` fallible - Updated `scan_action_iter` to return `DeltaResult<impl Iterator<...>>` - Updated 12 callsites across the codebase to propagate errors with `?` operator - Updated FFI layer to handle errors using ExternResult ## How was this change tested? - All 630 existing kernel tests pass - All 18 FFI tests pass - Verified compilation with `cargo check --all-features` - No functional changes - purely refactoring error handling patterns
This PR refactors the
new_expression_evaluatorandnew_predicate_evaluatormethods in theEvaluationHandlertrait to returnDeltaResultinstead of being infallible. Addresses #566.What changes are proposed in this pull request?
This is a breaking API change that enables:
This PR affects the following public APIs
new_expression_evaluatorandnew_predicate_evaluatorinEvaluationHandlerChanges:
EvaluationHandlertrait signatures to returnDeltaResult<Arc<dyn Evaluator>>ArrowEvaluationHandlerimplementation to wrap returns inOk(...)ScanLogReplayProcessor::newfalliblescan_action_iterto returnDeltaResult<impl Iterator<...>>?operatorHow was this change tested?
cargo check --all-features