elasticsearch/docs/reference/esql/functions
Nik Everett e1b1f6f1db
ESQL: Create Block.Ref (#100042)
This creates `Block.Ref`, a reference to a `Block` which may or may not
be part of a `Page`. `Block.Ref` is `Releasable` and closing it is a
noop if the `Block` is part of a `Page`, but if it is "free floating"
then closing the `Block.Ref` will close the block.

It also modified `ExpressionEvaluator` to return a `Block.Ref` instead
of a `Block` - so you tend to work with `ExpressionEvaluator`s like
this:

```
try (Block.Ref ref = eval.eval(page)) {
  return ref.block().doStuff();
}
```

This should make it *much* easier to release the memory from `Block`s
built by `ExpressionEvaluator`s.

This change is mostly mechanical, introducing the new signature for
`ExpressionEvaluator`. In a follow up change I'll modify the tests to
make sure we're correctly using it to close pages.

I did think about changing `ExpressionEvaluator` to add a method telling
you if the block that it returns must be closed or not. This would have
been more difficult to work with, and, ultimately, limiting.
Specifically, it is possible for an `ExpressionEvaluator` to *sometimes*
return a free floating block and other times return one that is
contained in a `Page`. Imagine `mv_concat` - it returns the block it
receives if the block doesn't have multivalued fields. Otherwise it
concats things. If that block happens to come directly out of the
`Page`, then `mv_concat` will sometimes produce free floating blocks and
sometimes not.
2023-09-29 09:26:44 -04:00
..
signature ESQL: Prevent CONCAT from using a ton of memory (#99716) 2023-09-22 11:27:13 -04:00
types ESQL: Create Block.Ref (#100042) 2023-09-29 09:26:44 -04:00
abs.asciidoc ESQL: Standardize font used in railroad diagrams (#98897) 2023-08-26 14:19:47 -04:00
acos.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
asin.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
atan.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
atan2.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
auto_bucket.asciidoc [DOCS] Some minor ES|QL docs fixes (#99423) 2023-09-11 16:20:10 +02:00
case.asciidoc Rename PROJECT command to KEEP (ESQL-1282) 2023-06-19 13:06:44 +02:00
ceil.asciidoc ESQL: Yet more function tests and docs (#99009) 2023-09-11 14:10:17 -04:00
cidr_match.asciidoc Move each function to its own file 2023-05-11 17:02:27 +02:00
coalesce.asciidoc ESQL: COALESCE function (#98542) 2023-08-17 13:51:44 -04:00
concat.asciidoc Rename PROJECT command to KEEP (ESQL-1282) 2023-06-19 13:06:44 +02:00
cos.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
cosh.asciidoc ESQL: Standardize font used in railroad diagrams (#98897) 2023-08-26 14:19:47 -04:00
date_extract.asciidoc Add date_extract function (ESQL-1346) 2023-07-19 14:08:06 +02:00
date_format.asciidoc ESQL: Swap arguments of remaining date_xxx() functions (#99561) 2023-09-19 20:22:34 +02:00
date_parse.asciidoc Add date_extract function (ESQL-1346) 2023-07-19 14:08:06 +02:00
date_trunc.asciidoc ESQL: date_trunc(): swap order of arguments (#98624) 2023-08-22 18:20:05 +02:00
e.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
ends_with.asciidoc Added esql ends_with implementation (#99613) 2023-09-18 11:29:20 -04:00
floor.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
greatest.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
is_finite.asciidoc Move each function to its own file 2023-05-11 17:02:27 +02:00
is_infinite.asciidoc Move each function to its own file 2023-05-11 17:02:27 +02:00
is_nan.asciidoc Move each function to its own file 2023-05-11 17:02:27 +02:00
least.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
left.asciidoc ESQL: Implement 'right' function (#98974) 2023-09-08 17:27:59 +02:00
length.asciidoc Rename PROJECT command to KEEP (ESQL-1282) 2023-06-19 13:06:44 +02:00
log10.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
ltrim.asciidoc ESQL: LTRIM, RTRIM and fix unicode whitespace (#98590) 2023-08-17 11:30:12 -04:00
mv_avg.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_concat.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_count.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_dedupe.asciidoc Implement MV_DEDUPE (ESQL-1287) 2023-06-27 08:13:19 -05:00
mv_max.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_median.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_min.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
mv_sum.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
now.asciidoc Implement now() function (ESQL-1172) 2023-06-27 12:01:09 +02:00
pi.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
pow.asciidoc [DOCS] Some minor ES|QL docs fixes (#99423) 2023-09-11 16:20:10 +02:00
right.asciidoc ESQL: Implement 'right' function (#98974) 2023-09-08 17:27:59 +02:00
round.asciidoc Move IS_NULL, POW, ROUND, STARTS_WITH, SUBSTRING code snippets to CSV files 2023-07-07 15:45:06 +02:00
rtrim.asciidoc ESQL: LTRIM, RTRIM and fix unicode whitespace (#98590) 2023-08-17 11:30:12 -04:00
sin.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
sinh.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
split.asciidoc Docs: convert the results into a table (ESQL-1143) 2023-05-17 16:00:15 -04:00
sqrt.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
starts_with.asciidoc Move IS_NULL, POW, ROUND, STARTS_WITH, SUBSTRING code snippets to CSV files 2023-07-07 15:45:06 +02:00
substring.asciidoc Move IS_NULL, POW, ROUND, STARTS_WITH, SUBSTRING code snippets to CSV files 2023-07-07 15:45:06 +02:00
tan.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
tanh.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
tau.asciidoc ESQL: More docs (#98890) 2023-08-28 11:17:04 -04:00
to_boolean.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
to_datetime.asciidoc Add date_extract function (ESQL-1346) 2023-07-19 14:08:06 +02:00
to_degrees.asciidoc Add to_degrees and to_radians functions (ESQL-1496) 2023-08-03 04:23:15 +10:00
to_double.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
to_integer.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
to_ip.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
to_long.asciidoc Docs: compress results into query (ESQL-1259) 2023-06-12 09:37:45 -05:00
to_radians.asciidoc Add to_degrees and to_radians functions (ESQL-1496) 2023-08-03 04:23:15 +10:00
to_string.asciidoc ESQL: Yet more function tests and docs (#99009) 2023-09-11 14:10:17 -04:00
to_unsigned_long.asciidoc Add unsigned_long type support (ESQL-1289) 2023-07-04 15:45:10 +02:00
to_version.asciidoc ESQL: Yet more function tests and docs (#99009) 2023-09-11 14:10:17 -04:00
trim.asciidoc Reused example from spec file 2023-07-10 10:17:12 +02:00