Skip to content

Commit 2769584

Browse files
authored
ESQL: Build functionName on the fly (#134395)
This removes a member variable we initiaized to the UPPER CASE name of the class in every function. This was costing us a couple dozen bytes for every function invocation in the plan in ESQL. Fine if there are 10 functions, annoying if there are thousands.
1 parent fc5a7ef commit 2769584

File tree

1 file changed

+1
-4
lines changed
  • x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/function

1 file changed

+1
-4
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/function/Function.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
* {@code EVAL}) or aggregation functions ({@code STATS}).
2222
*/
2323
public abstract class Function extends Expression {
24-
25-
private final String functionName = getClass().getSimpleName().toUpperCase(Locale.ROOT);
26-
2724
// TODO: Functions supporting distinct should add a dedicated constructor Location, List<Expression>, boolean
2825
protected Function(Source source, List<Expression> children) {
2926
super(source, children);
@@ -34,7 +31,7 @@ public final List<Expression> arguments() {
3431
}
3532

3633
public String functionName() {
37-
return functionName;
34+
return getClass().getSimpleName().toUpperCase(Locale.ROOT);
3835
}
3936

4037
@Override

0 commit comments

Comments
 (0)