-
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: Functions! #98545
Comments
Pinging @elastic/es-ql (Team:QL) |
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
I wrote up a guide to making new functions about six months ago that's gone stale. I'll try and build another guide for it on Monday. |
Here are some instructions for adding functions. |
@nik9000 Recheck out the main branch. Refactor the 'left' function to cut the prefix string in place. But I meet a adversity that left failed the test case 'testEvaluateInManyThreads'. I find that in multiple thread situation, ` EvalOperator.ExpressionEvaluator eval = evalSupplier.get(); for (int c = 0; c < count; c++) { assertThat(toJavaObject(eval.eval(page), 0), testCase.getMatcher()); } ` toJavaObject function return a BytesRef with length=2, content is [81,89]. However, assertThat function in junit4 receive the BytesRef parameters that its length is 10. Can you give me some clues? I can't find which variable is mutual. Rerun failed test case's command: `gradlew ':x-pack:plugin:esql:test' --tests "org.elasticsearch.xpack.esql.expression.function.scalar.string.LeftTests.testEvaluateInManyThreads {TestCase=Left basic test}" -Dtests.seed=44459C172243712 -Dtests.locale=lv-LV -Dtests.timezone=Asia/Irkutsk -Druntime.java=20`
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
- Added the cube root function to ESQL (`CBRT(x)`). Nearly identical to SQRT, but without the negative numbers exception - Added docs generation support for Windows end lines (CRLF), as within the examples, it was writing the "\r" without the "\n" (Which was being converted to "\\n"), and some other inconsistencies - Some updates to `package-info.java` documentation over how to create functions - Fixes #108675 Functions issue: #98545
With |
Yeah, I think we probably can just zap them. At most they can be aliases to DATE_EXTRACT. But they aren't nearly as important. @costin, what do you think of just crossing them out of hte list? |
Does |
I think |
Description
Description
This is a list of "shovel ready" functions. It's functions we are fairly sure we want and we should be able to start working on them now. This list is not sorted at all, partly because making any one of these functions shouldn't be a huge effort so the cost of having a sorted list is comparatively high.
This list is not sacred. If you need a function to do something, stick it on the list. Maybe even build it yourself, it's fun!
NULL
IP
Math
Sqrt
function for ESQL #98449SUM(a, b, c) - sum of columns, not an aggLet's just usea + b + c
orMV_SUM(a) + MV_SUM(b) + MV_SUM(c)
to_degrees
)to_radians
)String
ROOT
locale. ESQL: Add TO_UPPER and TO_LOWER functions #104309SPACE
function #112350Date
DATE_PART/DATEPARTfor now folks can use EXTRACTDAY_OF_MONTH/DOM/DAYfor now folks can use EXTRACTDAY_OF_WEEK/DAYOFWEEK/DOWfor now folks can use EXTRACTDAY_OF_YEAR/DOYfor now folks can use EXTRACTHOUR_OF_DAY/HOURfor now folks can use EXTRACTISO_DAY_OF_WEEK/ISODAYOFWEEK/ISODOW/IDOWfor now folks can use EXTRACTISO_WEEK_OF_YEAR/ISOWEEKOFYEAR/ISOWEEK/IWOY/IWfor now folks can use EXTRACTMINUTE_OF_DAYfor now folks can use EXTRACTMINUTE_OF_HOUR/MINUTEfor now folks can use EXTRACTMONTH_OF_YEAR/MONTHfor now folks can use EXTRACTSECOND_OF_MINUTE/SECONDfor now folks can use EXTRACTQUARTERfor now folks can use EXTRACTWEEK_OF_YEAR/WEEKfor now folks can use EXTRACTYEARfor now folks can use EXTRACTEncode/Decode
Secure Hashing
MessageDigest.getInstance
Aggregate (STATS ... BY)
The text was updated successfully, but these errors were encountered: