Skip to content

Commit 1c1f94e

Browse files
committed
Add SPARKLINE aggregation fuction
1 parent 0c27c55 commit 1c1f94e

File tree

31 files changed

+6033
-1
lines changed

31 files changed

+6033
-1
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,28 @@ tasks.named('stringTemplates').configure {
606606
it.outputFile = "org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java"
607607
}
608608

609+
File sparklineAggregatorInputFile = new File("${projectDir}/src/main/java/org/elasticsearch/compute/aggregation/X-SparklineAggregator.java.st")
610+
template {
611+
it.properties = intProperties
612+
it.inputFile = sparklineAggregatorInputFile
613+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineIntAggregator.java"
614+
}
615+
template {
616+
it.properties = longProperties
617+
it.inputFile = sparklineAggregatorInputFile
618+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineLongAggregator.java"
619+
}
620+
template {
621+
it.properties = floatProperties
622+
it.inputFile = sparklineAggregatorInputFile
623+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineFloatAggregator.java"
624+
}
625+
template {
626+
it.properties = doubleProperties
627+
it.inputFile = sparklineAggregatorInputFile
628+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java"
629+
}
630+
609631
File rateAggregatorInputFile = file("src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st")
610632
template {
611633
it.properties = intProperties

x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ private MethodSpec addIntermediateInput() {
539539
declarationType,
540540
requireVoidType(),
541541
requireName("combineIntermediate"),
542-
requireArgs(
542+
requireArgsStartsWith(
543543
Stream.concat(
544544
Stream.of(aggState.declaredType()), // aggState
545545
intermediateState.stream().map(IntermediateStateDesc::combineArgType) // intermediate state

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java

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

0 commit comments

Comments
 (0)