Skip to content

Commit df0e843

Browse files
committed
Add SPARKLINE aggregation fuction
1 parent b3a06fb commit df0e843

File tree

32 files changed

+6080
-2
lines changed

32 files changed

+6080
-2
lines changed

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

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

631+
File sparklineAggregatorInputFile = new File("${projectDir}/src/main/java/org/elasticsearch/compute/aggregation/X-SparklineAggregator.java.st")
632+
template {
633+
it.properties = intProperties
634+
it.inputFile = sparklineAggregatorInputFile
635+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineIntAggregator.java"
636+
}
637+
template {
638+
it.properties = longProperties
639+
it.inputFile = sparklineAggregatorInputFile
640+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineLongAggregator.java"
641+
}
642+
template {
643+
it.properties = floatProperties
644+
it.inputFile = sparklineAggregatorInputFile
645+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineFloatAggregator.java"
646+
}
647+
template {
648+
it.properties = doubleProperties
649+
it.inputFile = sparklineAggregatorInputFile
650+
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java"
651+
}
652+
631653
File rateAggregatorInputFile = file("src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st")
632654
template {
633655
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
@@ -604,7 +604,7 @@ private MethodSpec addIntermediateInput() {
604604
declarationType,
605605
requireVoidType(),
606606
requireName("combineIntermediate"),
607-
requireArgs(
607+
requireArgsStartsWith(
608608
Stream.concat(
609609
Stream.of(aggState.declaredType()), // aggState
610610
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)