-
Notifications
You must be signed in to change notification settings - Fork 513
expr, storage: Fix reduce error-propagation, LIKE, and CSV decoder bugs #36987
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
Changes from 3 commits
8c9014a
1901872
8264609
ea551aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,9 +51,17 @@ pub(super) fn reduce_call_variadic( | |
| *e = MirScalarExpr::literal_null(e.typ(column_types).scalar_type); | ||
| return; | ||
| } | ||
| if let Some(err) = exprs.iter().find_map(|x| x.as_literal_err()) { | ||
| *e = MirScalarExpr::literal(Err(err.clone()), e.typ(column_types).scalar_type); | ||
| return; | ||
| // Only a strict (null-propagating) function propagates an operand's error | ||
| // unconditionally. A non-strict function such as AND/OR has a dominating | ||
| // operand (`false`/`true`) that absorbs another operand's error at runtime | ||
| // — e.g. `false AND <error>` evaluates to `false` — so folding the whole | ||
| // call to the error here would introduce an error the evaluated expression | ||
| // never raises. (Coalesce, also non-strict, bailed out above.) | ||
| if func.propagates_nulls() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs optimizer review.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ggevay Are you familiar with this code?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'll review it |
||
| if let Some(err) = exprs.iter().find_map(|x| x.as_literal_err()) { | ||
| *e = MirScalarExpr::literal(Err(err.clone()), e.typ(column_types).scalar_type); | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| // Per-function dispatch. Arms are mutually exclusive on discriminant; the | ||
|
|
||
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.
What's even the point of having our own string matcher? I feel we could switch to the regex-rewriting for most (all?) cases.
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.
It'd be up to 700x slower in extreme cases based on trying it out.