From 3ac115c79883f868801ee4831ae532a001ace219 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 26 Aug 2025 16:59:06 -0400 Subject: [PATCH] ESQL: Update generated code When we compile the code for `CONTAINS` we generate an evaluator java class and commit that, as is our ancient custom. But because #133016 didn't see #133392, we committed out of date code. That's fine because we regenerate the code on every compile. But it's annoying because every clone is out of date. This updates the generated file. You may be asking "why do you commit the generated code if you just generate it at compile time?" That's a good question! It's a grand tradition, one that we will probably one day leave behind. But let's celebrate it today by committing more code. --- .../function/scalar/string/ContainsEvaluator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ContainsEvaluator.java b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ContainsEvaluator.java index cd4d40dabaec2..2a922687127d2 100644 --- a/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ContainsEvaluator.java +++ b/x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ContainsEvaluator.java @@ -8,6 +8,7 @@ import java.lang.Override; import java.lang.String; import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; @@ -25,6 +26,8 @@ * This class is generated. Edit {@code EvaluatorImplementer} instead. */ public final class ContainsEvaluator implements EvalOperator.ExpressionEvaluator { + private static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(ContainsEvaluator.class); + private final Source source; private final EvalOperator.ExpressionEvaluator str; @@ -60,6 +63,14 @@ public Block eval(Page page) { } } + @Override + public long baseRamBytesUsed() { + long baseRamBytesUsed = BASE_RAM_BYTES_USED; + baseRamBytesUsed += str.baseRamBytesUsed(); + baseRamBytesUsed += substr.baseRamBytesUsed(); + return baseRamBytesUsed; + } + public BooleanBlock eval(int positionCount, BytesRefBlock strBlock, BytesRefBlock substrBlock) { try(BooleanBlock.Builder result = driverContext.blockFactory().newBooleanBlockBuilder(positionCount)) { BytesRef strScratch = new BytesRef();