@@ -81,6 +81,26 @@ def prop(Name, Type, type, Wrapper, TYPE, BYTES, Array, Hash) {
8181 ]
8282}
8383
84+ def propWithoutExtra (prop1 ) {
85+ def res = [ " hasExtra" : " " ]
86+ for ( e in prop1 ) {
87+ res. put(e. key, e. value)
88+ res. put(" Extra" + e. key, " " )
89+ }
90+ return res
91+ }
92+
93+ def propWithExtra (prop1 , prop2 ) {
94+ def res = [ " hasExtra" : " true" ]
95+ for ( e in prop1 ) {
96+ res. put(e. key, e. value)
97+ }
98+ for ( e in prop2 ) {
99+ res. put(" Extra" + e. key, e. value)
100+ }
101+ return res
102+ }
103+
84104def addOccurrence (props , Occurrence ) {
85105 def newProps = props. collectEntries { [(it. key): it. value] }
86106 newProps[" Occurrence" ] = Occurrence
@@ -651,6 +671,28 @@ tasks.named('stringTemplates').configure {
651671 it. outputFile = " org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java"
652672 }
653673
674+ File sparklineAggregatorInputFile = new File (" ${ projectDir} /src/main/java/org/elasticsearch/compute/aggregation/X-SparklineAggregator.java.st" )
675+ template {
676+ it. properties = intProperties
677+ it. inputFile = sparklineAggregatorInputFile
678+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineIntAggregator.java"
679+ }
680+ template {
681+ it. properties = longProperties
682+ it. inputFile = sparklineAggregatorInputFile
683+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineLongAggregator.java"
684+ }
685+ template {
686+ it. properties = floatProperties
687+ it. inputFile = sparklineAggregatorInputFile
688+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineFloatAggregator.java"
689+ }
690+ template {
691+ it. properties = doubleProperties
692+ it. inputFile = sparklineAggregatorInputFile
693+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java"
694+ }
695+
654696 File stdDevAggregatorInputFile = file(" src/main/java/org/elasticsearch/compute/aggregation/X-StdDevAggregator.java.st" )
655697 template {
656698 it. properties = intProperties
@@ -875,25 +917,45 @@ tasks.named('stringTemplates').configure {
875917
876918 File bucketedSortInputFile = new File (" ${ projectDir} /src/main/java/org/elasticsearch/compute/data/sort/X-BucketedSort.java.st" )
877919 template {
878- it. properties = intProperties
920+ it. properties = propWithoutExtra( intProperties)
879921 it. inputFile = bucketedSortInputFile
880922 it. outputFile = " org/elasticsearch/compute/data/sort/IntBucketedSort.java"
881923 }
882924 template {
883- it. properties = longProperties
925+ it. properties = propWithoutExtra( longProperties)
884926 it. inputFile = bucketedSortInputFile
885927 it. outputFile = " org/elasticsearch/compute/data/sort/LongBucketedSort.java"
886928 }
887929 template {
888- it. properties = floatProperties
930+ it. properties = propWithoutExtra( floatProperties)
889931 it. inputFile = bucketedSortInputFile
890932 it. outputFile = " org/elasticsearch/compute/data/sort/FloatBucketedSort.java"
891933 }
892934 template {
893- it. properties = doubleProperties
935+ it. properties = propWithoutExtra( doubleProperties)
894936 it. inputFile = bucketedSortInputFile
895937 it. outputFile = " org/elasticsearch/compute/data/sort/DoubleBucketedSort.java"
896938 }
939+ template {
940+ it. properties = propWithExtra(longProperties, intProperties)
941+ it. inputFile = bucketedSortInputFile
942+ it. outputFile = " org/elasticsearch/compute/data/sort/LongIntBucketedSort.java"
943+ }
944+ template {
945+ it. properties = propWithExtra(longProperties, longProperties)
946+ it. inputFile = bucketedSortInputFile
947+ it. outputFile = " org/elasticsearch/compute/data/sort/LongLongBucketedSort.java"
948+ }
949+ template {
950+ it. properties = propWithExtra(longProperties, floatProperties)
951+ it. inputFile = bucketedSortInputFile
952+ it. outputFile = " org/elasticsearch/compute/data/sort/LongFloatBucketedSort.java"
953+ }
954+ template {
955+ it. properties = propWithExtra(longProperties, doubleProperties)
956+ it. inputFile = bucketedSortInputFile
957+ it. outputFile = " org/elasticsearch/compute/data/sort/LongDoubleBucketedSort.java"
958+ }
897959
898960 File enrichResultBuilderInput = file(" src/main/java/org/elasticsearch/compute/operator/lookup/X-EnrichResultBuilder.java.st" )
899961 template {
0 commit comments