-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Esql warnings in tests #98699
Esql warnings in tests #98699
Conversation
}), | ||
new TestCaseSupplier("long-double overflow", () -> { | ||
long base = 4339622345450989181L; // Not exactly representable as a double | ||
long expected = 4339622345450989056L; |
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.
This is a pretty concerning behavior. For longs > 2^52, which are not exactly representable as doubles, x^1 != x. I'm not sure what we should do about this.
Honestly, I think there's a strong argument that pow
should always return a double (which is what Java does), since most powers of large longs will overflow anyway.
Pinging @elastic/es-ql (Team:QL) |
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
this.expectedWarnings = null; | ||
} | ||
|
||
public TestCase( |
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.
This maybe should be private
just so it's normal to build it without the warnings and add, I guess.
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.
Like, I imagine it'd be nice if there was one "normal" way to do it.
This adds an ability to verify warnings in specific test cases. I added a few overflow tests to pow as an example. PR also includes other test, and wiring more pow examples into the parameterized framework.