Commit graph

19 commits

Author SHA1 Message Date
Nik Everett
f3b20067a3 Add PI and TAU functions (ESQL-1357)
Adds functions for the constants `PI` and it's big brother `TAU`.
2023-07-05 16:06:06 -05:00
Bogdan Pintea
48cb069670 Add unsigned_long type support (ESQL-1289)
This adds support for the `unsigned_long` type.
The type can be now used with the defined math function, both scalar and
MV'ed, arithmetic and binary comparison ones.
The `to_unsigned_long()` conversion function is also added.
2023-07-04 15:45:10 +02:00
Nik Everett
1a1941913d Implement MV_DEDUPE (ESQL-1287)
This implements the `MV_DEDUPE` function that removes duplicates from
multivalues fields. It wasn't strictly in our list of things we need in
the first release, but I'm grabbing this now because I realized I needed
very similar infrastructure when I was trying to build grouping by
multivalued fields. In fact, I realized that I could use our
stringtemplate code generation to generate most of the complex parts.
This generates the actual body of `MV_DEDUPE`'s implementation and the
body of the `Block` accepting `BlockHash` implementations. It'll be
useful in the final step for grouping by multivalued fields.

I also got pretty curious about whether the `O(n^2)` or `O(n*log(n))`
algorithm for deduplication is faster. I'd been assuming that for all
reasonable sized inputs the `O(n^2)` bubble sort looking selection
algorithm was faster. So I measured it. And it's mostly true - even for
`BytesRef` if you have a dozen entries the selection algorithm is
faster. Lower overhead and stuff. Anyway, to measure it I had to
implement the copy-and-sort `O(n*log(n))` algorithm. So while I was
there I plugged it in and selected it in cases where the number of
inputs is large and the selection alogorithm is likely to be slower.
2023-06-27 08:13:19 -05:00
Luigi Dell'Aquila
c2c0b0fa0d Implement now() function (ESQL-1172)
returns current datetime
2023-06-27 12:01:09 +02:00
Nik Everett
35fddc2281 Create e() function (ESQL-1304)
Euler's number.
2023-06-22 10:02:23 -04:00
Luigi Dell'Aquila
100ca0acca Rename PROJECT command to KEEP (ESQL-1282) 2023-06-19 13:06:44 +02:00
Nik Everett
1f383f3cd2 Docs: compress results into query (ESQL-1259)
This compresses the results and the query on the page to take up less
space and make them more obviously connected.
2023-06-12 09:37:45 -05:00
Bogdan Pintea
1e268fa0f0 Introduce version type support (ESQL-1218)
This adds support for the type `version`.
The conversion function `to_version()` has also beed added;
`to_string()` now supports the type as well.
2023-06-06 10:39:51 +10:00
Bogdan Pintea
33776045f6 Add docs for the conversion functions (ESQL-1217)
Add docs for the `to_xxx()` conversion functions.

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-06-06 01:32:14 +10:00
Nik Everett
be7e182a6c Rename mv_join to mv_concat (ESQL-1213)
That's not the name SPL uses for this, but it's a much more intuitive
name.

Closes ESQL-1210
2023-06-01 05:48:04 +10:00
Nik Everett
024217ba27 Docs for auto_bucket (ESQL-1208)
This adds some docs for the `auto_bucket` command.

---------

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2023-06-01 03:49:39 +10:00
Nik Everett
64e41ef100 Add mv_join function (ESQL-1166)
Adds an `mv_join` function that joins together multivalue string fields.
You can combine this with out fancy new `to_string` to join together any
multivalued fields into a string.
2023-05-25 02:32:23 +10:00
Nik Everett
efe8bdef3a Add mv_median function (ESQL-1164)
This adds a `mv_median` function that converts a multivalued field into
a single valued field by picking the median. If there are an even number
of values we return the average of the middle two numbers. If the input
type is `int` or `long` then the average rounds *down*.
2023-05-23 17:01:08 -04:00
Nik Everett
75a6ac1ed1 Docs: convert the results into a table (ESQL-1143)
This moves the results in the esql examples from preformatted text to an
actual html table. We can further format it from there.
2023-05-17 16:00:15 -04:00
Nik Everett
b7b9f71a49 Implement mv_count (ESQL-1126)
Implements the `mv_count` function which returns a count of the values
in a column.
2023-05-12 15:57:49 -04:00
Abdon Pijpelink
35356b86a2 Move each function to its own file 2023-05-11 17:02:27 +02:00
Nik Everett
555781a8a0 Docs for remaining mv functions (ESQL-1114)
This adds docs for all of the remaining `mv_*` functions that have been
implemented at this point.
2023-05-11 07:03:58 -04:00
Nik Everett
ce1d634d77 Docs for mv_min (ESQL-1092)
This adds docs for the `mv_min` function. It uses an as yet unsupported
syntax, `ROW a=[2,1]`, but I think we'll support it before long.
2023-05-10 17:26:59 -04:00
Nik Everett
87e6fcc948 Docs for split (ESQL-1084)
This adds docs for the new `split` function.
2023-05-04 06:26:48 -04:00