-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
evalengine: implement AggregateEvalTypes #15085
Conversation
Signed-off-by: Vicent Marti <vmg@strn.cat>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Vicent Marti <vmg@strn.cat>
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 think we should have some tests for this as well?
Signed-off-by: Vicent Marti <vmg@strn.cat>
Tests added, and whattdoyaknow they even caught a missing TODO that I've just implemented. :) |
@@ -0,0 +1,62 @@ | |||
package evalengine |
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.
🕺 License yo
Signed-off-by: Vicent Marti <vmg@strn.cat>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #15085 +/- ##
=======================================
Coverage 47.70% 47.70%
=======================================
Files 1155 1155
Lines 240231 240264 +33
=======================================
+ Hits 114610 114629 +19
- Misses 117018 117032 +14
Partials 8603 8603 ☔ View full report in Codecov by Sentry. |
case sqltypes.Uint32: | ||
return sqltypes.Int64 | ||
case sqltypes.Uint64: | ||
return sqltypes.Decimal |
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.
Anything where this happens in practice? Wouldn’t instead MySQL fail with an overflow error if this happens?
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.
No, this is not an overflow, this is explicitly listed in the refman:
If there is a combination of signed and unsigned integer types, the result is signed and the precision may be higher. For example, if the types are signed INT and unsigned INT, the result is signed BIGINT.
The exception is unsigned BIGINT combined with any signed integer type. The result is DECIMAL with sufficient precision and scale 0.
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.
One question I had but doesn’t have to be blocking.
Description
As requested by @systay in #15069 (review), this PR implements a helper in the
evalengine
that performs type aggregation on the engine's nativeType
struct, as opposed tosqltypes.Type
which is what we were previously using.cc @dbussink
Related Issue(s)
Checklist
Deployment Notes