@@ -78,6 +78,7 @@ def prop(Name, Type, type, Wrapper, TYPE, BYTES, Array, Hash) {
7878 " boolean" : Name == " Boolean" ? " true" : " " ,
7979 " BytesRef" : Name == " BytesRef" ? " true" : " " ,
8080 " Ip" : Name == " Ip" ? " true" : " " ,
81+ " Tuple" : Name . startsWith(" Tuple" ) ? " true" : " " ,
8182 ]
8283}
8384
@@ -107,6 +108,10 @@ tasks.named('stringTemplates').configure {
107108 " BytesRefHash"
108109 )
109110 var ipProperties = prop(" Ip" , " BytesRef" , " BytesRef" , " " , " BYTES_REF" , " 16" , " " , " " )
111+ var tupleLongIntProperties = prop(" TupleLongInt" , " Int" , " Tuple<Long, Integer>" , " Integer" , " OBJECT" , " Long.BYTES + Integer.BYTES" , " ObjectArray<Tuple<Long, Integer>>" , " " )
112+ var tupleLongFloatProperties = prop(" TupleLongFloat" , " Float" , " Tuple<Long, Float>" , " Float" , " OBJECT" , " Long.BYTES + Float.BYTES" , " ObjectArray<Tuple<Long, Float>>" , " " )
113+ var tupleLongLongProperties = prop(" TupleLongLong" , " Long" , " Tuple<Long, Long>" , " Long" , " OBJECT" , " 2 * Long.BYTES" , " ObjectArray<Tuple<Long, Long>>" , " " )
114+ var tupleLongDoubleProperties = prop(" TupleLongDouble" , " Double" , " Tuple<Long, Double>" , " Double" , " OBJECT" , " Long.BYTES + Double.BYTES" , " ObjectArray<Tuple<Long, Double>>" , " " )
110115
111116 // primitive vectors
112117 File vectorInputFile = new File (" ${ projectDir} /src/main/java/org/elasticsearch/compute/data/X-Vector.java.st" )
@@ -628,6 +633,28 @@ tasks.named('stringTemplates').configure {
628633 it. outputFile = " org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java"
629634 }
630635
636+ File sparklineAggregatorInputFile = new File (" ${ projectDir} /src/main/java/org/elasticsearch/compute/aggregation/X-SparklineAggregator.java.st" )
637+ template {
638+ it. properties = intProperties
639+ it. inputFile = sparklineAggregatorInputFile
640+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineIntAggregator.java"
641+ }
642+ template {
643+ it. properties = longProperties
644+ it. inputFile = sparklineAggregatorInputFile
645+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineLongAggregator.java"
646+ }
647+ template {
648+ it. properties = floatProperties
649+ it. inputFile = sparklineAggregatorInputFile
650+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineFloatAggregator.java"
651+ }
652+ template {
653+ it. properties = doubleProperties
654+ it. inputFile = sparklineAggregatorInputFile
655+ it. outputFile = " org/elasticsearch/compute/aggregation/SparklineDoubleAggregator.java"
656+ }
657+
631658 File rateAggregatorInputFile = file(" src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st" )
632659 template {
633660 it. properties = intProperties
@@ -893,6 +920,26 @@ tasks.named('stringTemplates').configure {
893920 it. inputFile = bucketedSortInputFile
894921 it. outputFile = " org/elasticsearch/compute/data/sort/DoubleBucketedSort.java"
895922 }
923+ template {
924+ it. properties = tupleLongIntProperties
925+ it. inputFile = bucketedSortInputFile
926+ it. outputFile = " org/elasticsearch/compute/data/sort/TupleLongIntBucketedSort.java"
927+ }
928+ template {
929+ it. properties = tupleLongLongProperties
930+ it. inputFile = bucketedSortInputFile
931+ it. outputFile = " org/elasticsearch/compute/data/sort/TupleLongLongBucketedSort.java"
932+ }
933+ template {
934+ it. properties = tupleLongFloatProperties
935+ it. inputFile = bucketedSortInputFile
936+ it. outputFile = " org/elasticsearch/compute/data/sort/TupleLongFloatBucketedSort.java"
937+ }
938+ template {
939+ it. properties = tupleLongDoubleProperties
940+ it. inputFile = bucketedSortInputFile
941+ it. outputFile = " org/elasticsearch/compute/data/sort/TupleLongDoubleBucketedSort.java"
942+ }
896943
897944 File enrichResultBuilderInput = file(" src/main/java/org/elasticsearch/compute/operator/lookup/X-EnrichResultBuilder.java.st" )
898945 template {
0 commit comments