Skip to content

ES|QL: Add SPARKLINE aggregation fuction #132568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions x-pack/plugin/esql/compute/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,28 @@ tasks.named('stringTemplates').configure {
it.outputFile = "org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java"
}

File sparklineAggregatorInputFile = new File("${projectDir}/src/main/java/org/elasticsearch/compute/aggregation/X-SparklineAggregator.java.st")
template {
it.properties = intProperties
it.inputFile = sparklineAggregatorInputFile
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineIntAggregator.java"
}
template {
it.properties = longProperties
it.inputFile = sparklineAggregatorInputFile
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineLongAggregator.java"
}
template {
it.properties = floatProperties
it.inputFile = sparklineAggregatorInputFile
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineFloatAggregator.java"
}
template {
it.properties = doubleProperties
it.inputFile = sparklineAggregatorInputFile
it.outputFile = "org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java"
}

File rateAggregatorInputFile = file("src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st")
template {
it.properties = intProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ private MethodSpec addIntermediateInput() {
declarationType,
requireVoidType(),
requireName("combineIntermediate"),
requireArgs(
requireArgsStartsWith(
Stream.concat(
Stream.of(aggState.declaredType()), // aggState
intermediateState.stream().map(IntermediateStateDesc::combineArgType) // intermediate state
Expand Down

Large diffs are not rendered by default.

Loading