Skip to content

Commit 540147e

Browse files
romuletselasticsearchmachine
authored andcommitted
Update FIRST and LAST to accept keyword and text (elastic#133642)
* add first and last by timestamp * receive breaker via driverContext * rearrange attributes to touch less files * create and release only one BreakingBytesRefBuilder per group * [CI] Auto commit changes from spotless * Use BreakingBytesRefBuilder in LongBytesRefState * Add tests for text * Add unit tests * Add label to circuit breaker * Format code * Label strings functionality to not fail tests * sort ip test to keep consistent * sort last and first test to keep it consistent --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent 0183bb6 commit 540147e

File tree

39 files changed

+2402
-45
lines changed

39 files changed

+2402
-45
lines changed

docs/reference/query-languages/esql/_snippets/functions/types/first.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/types/last.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/kibana/definition/functions/first.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/kibana/definition/functions/last.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ tasks.named('stringTemplates').configure {
477477
*/
478478
File twoStateInputFile = file("src/main/java/org/elasticsearch/compute/aggregation/X-2State.java.st")
479479
[longProperties].forEach { v1 ->
480-
[intProperties, longProperties, floatProperties, doubleProperties].forEach { v2 ->
480+
[intProperties, longProperties, floatProperties, doubleProperties, bytesRefProperties].forEach { v2 ->
481481
{
482482
var properties = [:]
483483
v1.forEach { k, v -> properties["v1_" + k] = v}
@@ -945,6 +945,11 @@ tasks.named('stringTemplates').configure {
945945
it.inputFile = valueByTimestampAggregatorInputFile
946946
it.outputFile = "org/elasticsearch/compute/aggregation/${Occurrence}DoubleByTimestampAggregator.java"
947947
}
948+
template {
949+
it.properties = addOccurrence(bytesRefProperties, Occurrence)
950+
it.inputFile = valueByTimestampAggregatorInputFile
951+
it.outputFile = "org/elasticsearch/compute/aggregation/${Occurrence}BytesRefByTimestampAggregator.java"
952+
}
948953
}
949954
}
950955
}

0 commit comments

Comments
 (0)