-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[ES|QL] Add hypot function #114382
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
[ES|QL] Add hypot function #114382
Conversation
Adds a hypotenuse function
Documentation preview: |
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.
Changes look great. Thank you, Larisa! I'd like someone from the ES|QL team to take another look.
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Pinging @elastic/kibana-esql (ES|QL-ui) |
Hi @limotova, I've created a changelog YAML for you. |
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.
Looks good!
3.0 | 4.0 | 5.0 | ||
// end::hypot-result[] | ||
; | ||
|
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 would add some extra cases:
- Having
null
in one and both parameters - Another one using
FROM
instead ofROW
, as they work differently (ROW
may get folded as it's all constants, for example)
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 added some tests..! I wasn't able to find any sample data with numbers specifically that would make more sense to calculate the hypotenuse of, so I hope it's alright that some of them are a little nonsensical
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.
employees also has some numeric data types - integer, double, long etc., if you are looking for data types besides unsigned long. They are usable, although a little nonsensical too.
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 doesn't really matter if they make sense IMO, as long as they come from an index. For interesting values, there's already the function tests
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. Thank you!
💚 Backport successful
|
Adds a hypotenuse function
Adds a hypotenuse function
Adds a hypotenuse function
Adds a hypotenuse function