Skip to content

Commit

Permalink
simplify element size in template
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Sep 21, 2023
1 parent f38116d commit 00e708c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugin/esql/compute/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00e708c

Please sign in to comment.