-
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
Add ES|QL signum function #106866
Add ES|QL signum function #106866
Conversation
Documentation preview: |
Hi @ioanatia, I've created a changelog YAML for you. |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
-100 | -1.0 | ||
; | ||
|
||
signumOfZeroInteger#[skip:-8.13.99,reason:new scalar function added in 8.14] |
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've been leaning towards putting these in floats.csv-spec
and ints.csv-spec
and unsigned_long.csv-spec
.
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.
Done - and in this case, I also don't need to add #[skip:-8.13.99,reason:new scalar function added in 8.14]
?
doesn't seem like it from the other specs in these files.
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.
If it's new I believe you still need it. I believe we'll be transitioning these to the "features" APIs before too long, but that's half way through at the moment so I'd stick with the skips.
You have to run something like ./gradlew -p x-pack/plugin/esql/qa/server/mixed-cluster v8.13.1#bwcTest
to bump into it.
@@ -0,0 +1,15 @@ | |||
// This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it. |
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.
If you link to this file in math-functions.asciidoc
then we'll render the generated docs.
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.
Would you mind updating the package-info.java
file with instructions to do this? I should have done it when I wrote the code generation, but I forgot.
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.
Done and done! the package-info.java
instructions are great btw!
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.
Thank you for your contribution.
Having csv-spec tests that only use row
is not enough.
Take a look at other csv-spec files where from
command is used and try to have more complex queries with nested functions, using the signum
function in all other commands (sort, eval, filter, stats etc).
Ah! I should have caught that one. |
@astefan - more tests have been added and Nik reviewed the PR again yesterday. |
#98545
Implements the signum function.
result: