Skip to content

Commit 2f82dfc

Browse files
committed
population and generator files done, just have to make the StdDevSample.java etc files
1 parent 8c25295 commit 2f82dfc

File tree

71 files changed

+8852
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+8852
-49
lines changed

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

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ def addOccurrence(props, Occurrence) {
8888
return newProps
8989
}
9090

91+
def addStdDevType(props, Variation) {
92+
def newProps = props.collectEntries { [(it.key): it.value] }
93+
newProps["Variation"] = Variation
94+
def enumName = Variation == "StdDevPopulation" ? "POPULATION" :
95+
Variation == "StdDevSample" ? "SAMPLE" :
96+
Variation == "VariancePopulation" ? "POPULATION_VARIANCE" :
97+
"SAMPLE_VARIANCE"
98+
newProps["EnumName"] = enumName
99+
return newProps
100+
}
101+
91102
tasks.named('stringTemplates').configure {
92103
var intProperties = prop("Int", "Int", "int", "Integer", "INT", "Integer.BYTES", "IntArray", "LongHash")
93104
var floatProperties = prop("Float", "Float", "float", "Float", "FLOAT", "Float.BYTES", "FloatArray", "LongHash")
@@ -628,25 +639,29 @@ tasks.named('stringTemplates').configure {
628639
}
629640

630641
File stdDevAggregatorInputFile = file("src/main/java/org/elasticsearch/compute/aggregation/X-StdDevAggregator.java.st")
631-
template {
632-
it.properties = intProperties
633-
it.inputFile = stdDevAggregatorInputFile
634-
it.outputFile = "org/elasticsearch/compute/aggregation/StdDevIntAggregator.java"
635-
}
636-
template {
637-
it.properties = longProperties
638-
it.inputFile = stdDevAggregatorInputFile
639-
it.outputFile = "org/elasticsearch/compute/aggregation/StdDevLongAggregator.java"
640-
}
641-
template {
642-
it.properties = floatProperties
643-
it.inputFile = stdDevAggregatorInputFile
644-
it.outputFile = "org/elasticsearch/compute/aggregation/StdDevFloatAggregator.java"
645-
}
646-
template {
647-
it.properties = doubleProperties
648-
it.inputFile = stdDevAggregatorInputFile
649-
it.outputFile = "org/elasticsearch/compute/aggregation/StdDevDoubleAggregator.java"
642+
["StdDevPopulation", "StdDevSample", "VariancePopulation", "VarianceSample"].forEach { Variation ->
643+
{
644+
template {
645+
it.properties = addStdDevType(intProperties, Variation)
646+
it.inputFile = stdDevAggregatorInputFile
647+
it.outputFile = "org/elasticsearch/compute/aggregation/${Variation}IntAggregator.java"
648+
}
649+
template {
650+
it.properties = addStdDevType(longProperties, Variation)
651+
it.inputFile = stdDevAggregatorInputFile
652+
it.outputFile = "org/elasticsearch/compute/aggregation/${Variation}LongAggregator.java"
653+
}
654+
template {
655+
it.properties = addStdDevType(floatProperties, Variation)
656+
it.inputFile = stdDevAggregatorInputFile
657+
it.outputFile = "org/elasticsearch/compute/aggregation/${Variation}FloatAggregator.java"
658+
}
659+
template {
660+
it.properties = addStdDevType(doubleProperties, Variation)
661+
it.inputFile = stdDevAggregatorInputFile
662+
it.outputFile = "org/elasticsearch/compute/aggregation/${Variation}DoubleAggregator.java"
663+
}
664+
}
650665
}
651666

652667
File sampleAggregatorInputFile = new File("${projectDir}/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st")

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

Lines changed: 66 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/src/main/generated-src/org/elasticsearch/compute/aggregation/StdDevPopulationFloatAggregator.java

Lines changed: 66 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/src/main/generated-src/org/elasticsearch/compute/aggregation/StdDevPopulationIntAggregator.java

Lines changed: 66 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/src/main/generated-src/org/elasticsearch/compute/aggregation/StdDevPopulationLongAggregator.java

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

0 commit comments

Comments
 (0)