-
Notifications
You must be signed in to change notification settings - Fork 46
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 ExpressionHandler::get_evaluator
fallible
#577
base: main
Are you sure you want to change the base?
feat: make ExpressionHandler::get_evaluator
fallible
#577
Conversation
Make get_evaluator() return DeltaResult<Arc<dyn ExpressionEvaluator>> to properly handle potential errors. Update all call sites to handle the Result type and simplify error handling using the ok()? operator where appropriate.
STATS_EXPR.clone(), | ||
DataType::STRING, | ||
) | ||
.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.
Should we have at least a warn!
log or similar, to alert when these errors happen? Otherwise I worry it could be very difficult to debug why data skipping does not occur?
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.
agreed, this is the one part I wasn't too sure about
kernel/src/scan/log_replay.rs
Outdated
table_schema: &SchemaRef, | ||
predicate: Option<ExpressionRef>, | ||
) -> impl Iterator<Item = DeltaResult<ScanData>> { | ||
) -> Box<dyn Iterator<Item = DeltaResult<ScanData>>> { |
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.
We should consider returning DeltaResult<impl Iterator>
, so the error is immediately obvious instead of buried in the iterator itself. Plenty of examples of that elsewhere in the kernel.
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.
done!
…tions - Modified scan_action_iter to return DeltaResult<impl Iterator> - Fixed code formatting in log_replay.rs files - Reordered imports in mod.rs for better readability - Improved error propagation in transaction.rs Co-Authored-By: Calvin Giroud <[email protected]>
Added warning logs when evaluator creation fails in DataSkippingFilter: - Log stats selector evaluator failures - Log skipping evaluator failures - Log filter evaluator failures This improves debuggability when data skipping does not occur as expected. Co-Authored-By: Calvin Giroud <[email protected]>
…olving conflicts Co-Authored-By: Calvin Giroud <[email protected]>
Fixes #566 . Makes get_evaluator() return DeltaResult<Arc> to properly handle potential errors. This change is intended to support
get_evaluator()
doing eager validation checking, but doesn't do the validation itself.What changes are proposed in this pull request?
Here's a comprehensive summary of all changes made:
How was this change tested?
Tested with
cargo test --all-features --all-targets -- --skip read_table_version_hdfs
. Had an issue with getting Java setup but that test doesn't seem relevant to the PR. No new tests need to be written since it's a no-op refactor.Additional Context
This PR was entirely written by Devin with a little bit of review from me. Happy to address any feedback and get this over the finish line.
Original Run: https://preview.devin.ai/sessions/e839a4e9bcb444b69b99205babdcf1af