From 00e708cdc1b4a51d139c5e7cfdf2caf7018dc050 Mon Sep 17 00:00:00 2001 From: ChrisHegarty Date: Thu, 21 Sep 2023 10:13:48 +0100 Subject: [PATCH] simplify element size in template --- x-pack/plugin/esql/compute/build.gradle | 2 +- .../java/org/elasticsearch/compute/data/X-BlockBuilder.java.st | 2 +- .../java/org/elasticsearch/compute/data/X-VectorBuilder.java.st | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/esql/compute/build.gradle b/x-pack/plugin/esql/compute/build.gradle index 6058770f25d1b..cd4b131a5b0fe 100644 --- a/x-pack/plugin/esql/compute/build.gradle +++ b/x-pack/plugin/esql/compute/build.gradle @@ -50,7 +50,7 @@ tasks.named('stringTemplates').configure { var longProperties = prop("Long", "long", "LONG", "Long.BYTES") var doubleProperties = prop("Double", "double", "DOUBLE", "Double.BYTES") var bytesRefProperties = prop("BytesRef", "BytesRef", "BYTES_REF", "org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF") - var booleanProperties = prop("Boolean", "boolean", "BOOLEAN", "Boolean.BYTES") + var booleanProperties = prop("Boolean", "boolean", "BOOLEAN", "Byte.BYTES") // primitive vectors File vectorInputFile = new File("${projectDir}/src/main/java/org/elasticsearch/compute/data/X-Vector.java.st") template { diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-BlockBuilder.java.st b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-BlockBuilder.java.st index 34c528bff1a58..2c2ae709074d0 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-BlockBuilder.java.st +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-BlockBuilder.java.st @@ -64,7 +64,7 @@ $endif$ @Override protected int elementSize() { - return $if(BytesRef)$-1$else$$if(boolean)$Byte$elseif(int)$Integer$elseif(long)$Long$else$Double$endif$.BYTES$endif$; + return $if(BytesRef)$-1$else$$BYTES$$endif$; } @Override diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorBuilder.java.st b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorBuilder.java.st index 2a5f4a15b8f8a..09e95e16c303d 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorBuilder.java.st +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorBuilder.java.st @@ -60,7 +60,7 @@ $endif$ @Override protected int elementSize() { - return $if(BytesRef)$-1$else$$if(boolean)$Byte$elseif(int)$Integer$elseif(long)$Long$else$Double$endif$.BYTES$endif$; + return $if(BytesRef)$-1$else$$BYTES$$endif$; } @Override