-
Notifications
You must be signed in to change notification settings - Fork 600
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(expression): Implement IS [NOT] DISTINCT FROM in backend #2676
Conversation
…into steven/distinct_from_backend
Codecov Report
@@ Coverage Diff @@
## main #2676 +/- ##
==========================================
+ Coverage 72.14% 72.34% +0.19%
==========================================
Files 681 685 +4
Lines 88502 89062 +560
==========================================
+ Hits 63849 64430 +581
+ Misses 24653 24632 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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!
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
Some comments out of the scope of this PR:
Historically, when comparing decimal
against f32
, we though they should TryInto
decimal
or f64
. But in PostgreSQL the common type for them is f32
.
This affects existing comparisons including eq, ne, lt, etc as well. The macro is using f64
and some unit tests are using decimal
. This can be fixed in a separate PR.
src/common/src/types/mod.rs
Outdated
/// `for_all_cmp_types` helps in matching and casting types when building comparison expressions | ||
/// such as <= or IS DISTINCT FROM. | ||
#[macro_export] | ||
macro_rules! for_all_cmp_variants { |
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.
Can we keep this macro in crate expr
rather than in crate common
?
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.
Sure. Would /expr/src/expr/template.rs
be a suitable place for it?
What's changed and what's your intention?
IS [NOT] DISTINCT FROM
from frontend to backend to avoid repeated evaluation of expressions (see feat(expr): Implement IS [NOT] DISTINCT FROM expression #2582)IS NOT DISTINCT FROM
, the frontend just binds aNOT
to the boundIS DISTINCT FROM
expressionIS [NOT] DISTINCT FROM
Checklist
Refer to a related PR or issue link (optional)
Fixes #2684