mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
ESQL: TO_LOWER process all values (#124676)
Make `TO_LOWER` and `TO_UPPER` process all values it received. This is quite large because it borrows a lot of code from the regular evaluator generator to generate conversions so we can use the Locale. That change propagates to the order of some parameters and to the `toString` and a few more places. Closes #124002
This commit is contained in:
parent
d81c7995a7
commit
1e25a54ac5
124 changed files with 2103 additions and 1135 deletions
6
docs/changelog/124676.yaml
Normal file
6
docs/changelog/124676.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
pr: 124676
|
||||
summary: TO_LOWER processes all values
|
||||
area: ES|QL
|
||||
type: bug
|
||||
issues:
|
||||
- 124002
|
|
@ -23,7 +23,6 @@ import javax.lang.model.element.TypeElement;
|
|||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.lang.model.util.Elements;
|
||||
|
||||
import static org.elasticsearch.compute.gen.Methods.appendMethod;
|
||||
import static org.elasticsearch.compute.gen.Methods.buildFromFactory;
|
||||
import static org.elasticsearch.compute.gen.Methods.getMethod;
|
||||
import static org.elasticsearch.compute.gen.Types.ABSTRACT_CONVERT_FUNCTION_EVALUATOR;
|
||||
|
@ -41,27 +40,34 @@ import static org.elasticsearch.compute.gen.Types.vectorType;
|
|||
public class ConvertEvaluatorImplementer {
|
||||
|
||||
private final TypeElement declarationType;
|
||||
private final ExecutableElement processFunction;
|
||||
private final EvaluatorImplementer.ProcessFunction processFunction;
|
||||
private final String extraName;
|
||||
private final ClassName implementation;
|
||||
private final TypeName argumentType;
|
||||
private final TypeName resultType;
|
||||
private final List<TypeMirror> warnExceptions;
|
||||
|
||||
public ConvertEvaluatorImplementer(
|
||||
Elements elements,
|
||||
javax.lang.model.util.Types types,
|
||||
ExecutableElement processFunction,
|
||||
String extraName,
|
||||
List<TypeMirror> warnExceptions
|
||||
) {
|
||||
this.declarationType = (TypeElement) processFunction.getEnclosingElement();
|
||||
this.processFunction = processFunction;
|
||||
if (processFunction.getParameters().size() != 1) {
|
||||
throw new IllegalArgumentException("processing function should have exactly one parameter");
|
||||
this.processFunction = new EvaluatorImplementer.ProcessFunction(types, processFunction, warnExceptions);
|
||||
|
||||
if (this.processFunction.args.getFirst() instanceof EvaluatorImplementer.StandardProcessFunctionArg == false) {
|
||||
throw new IllegalArgumentException("first argument must be the field to process");
|
||||
}
|
||||
for (int a = 1; a < this.processFunction.args.size(); a++) {
|
||||
if (this.processFunction.args.get(a) instanceof EvaluatorImplementer.FixedProcessFunctionArg == false) {
|
||||
throw new IllegalArgumentException("fixed function args supported after the first");
|
||||
// TODO support more function types when we need them
|
||||
}
|
||||
}
|
||||
|
||||
this.extraName = extraName;
|
||||
this.argumentType = TypeName.get(processFunction.getParameters().get(0).asType());
|
||||
this.resultType = TypeName.get(processFunction.getReturnType());
|
||||
this.warnExceptions = warnExceptions;
|
||||
|
||||
this.implementation = ClassName.get(
|
||||
|
@ -87,29 +93,36 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.addModifiers(Modifier.PUBLIC, Modifier.FINAL);
|
||||
builder.superclass(ABSTRACT_CONVERT_FUNCTION_EVALUATOR);
|
||||
|
||||
for (EvaluatorImplementer.ProcessFunctionArg a : processFunction.args) {
|
||||
a.declareField(builder);
|
||||
}
|
||||
builder.addMethod(ctor());
|
||||
builder.addMethod(name());
|
||||
builder.addMethod(next());
|
||||
builder.addMethod(evalVector());
|
||||
builder.addMethod(evalValue(true));
|
||||
builder.addMethod(evalBlock());
|
||||
builder.addMethod(evalValue(false));
|
||||
builder.addMethod(processFunction.toStringMethod(implementation));
|
||||
builder.addMethod(processFunction.close());
|
||||
builder.addType(factory());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec ctor() {
|
||||
MethodSpec.Builder builder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(EXPRESSION_EVALUATOR, "field");
|
||||
builder.addParameter(SOURCE, "source");
|
||||
builder.addStatement("super(driverContext, source)");
|
||||
for (EvaluatorImplementer.ProcessFunctionArg a : processFunction.args) {
|
||||
a.implementCtor(builder);
|
||||
}
|
||||
builder.addParameter(DRIVER_CONTEXT, "driverContext");
|
||||
builder.addStatement("super(driverContext, field, source)");
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec name() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("name").addModifiers(Modifier.PUBLIC);
|
||||
builder.addAnnotation(Override.class).returns(String.class);
|
||||
builder.addStatement("return $S", declarationType.getSimpleName() + extraName);
|
||||
private MethodSpec next() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("next").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);
|
||||
builder.returns(EXPRESSION_EVALUATOR);
|
||||
builder.addStatement("return $N", ((EvaluatorImplementer.StandardProcessFunctionArg) processFunction.args.getFirst()).name());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -129,7 +142,7 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.beginControlFlow("if (vector.isConstant())");
|
||||
{
|
||||
catchingWarnExceptions(builder, () -> {
|
||||
var constVectType = blockType(resultType);
|
||||
var constVectType = processFunction.resultDataType(true);
|
||||
builder.addStatement(
|
||||
"return driverContext.blockFactory().newConstant$TWith($N, positionCount)",
|
||||
constVectType,
|
||||
|
@ -139,7 +152,7 @@ public class ConvertEvaluatorImplementer {
|
|||
}
|
||||
builder.endControlFlow();
|
||||
|
||||
ClassName resultBuilderType = builderType(blockType(resultType));
|
||||
ClassName resultBuilderType = builderType(processFunction.resultDataType(true));
|
||||
builder.beginControlFlow(
|
||||
"try ($T builder = driverContext.blockFactory().$L(positionCount))",
|
||||
resultBuilderType,
|
||||
|
@ -150,7 +163,11 @@ public class ConvertEvaluatorImplementer {
|
|||
{
|
||||
catchingWarnExceptions(
|
||||
builder,
|
||||
() -> builder.addStatement("builder.$L($N)", appendMethod(resultType), evalValueCall("vector", "p", scratchPadName)),
|
||||
() -> builder.addStatement(
|
||||
"builder.$L($N)",
|
||||
processFunction.appendMethod(),
|
||||
evalValueCall("vector", "p", scratchPadName)
|
||||
),
|
||||
() -> builder.addStatement("builder.appendNull()")
|
||||
);
|
||||
}
|
||||
|
@ -185,7 +202,7 @@ public class ConvertEvaluatorImplementer {
|
|||
TypeName blockType = blockType(argumentType);
|
||||
builder.addStatement("$T block = ($T) b", blockType, blockType);
|
||||
builder.addStatement("int positionCount = block.getPositionCount()");
|
||||
TypeName resultBuilderType = builderType(blockType(resultType));
|
||||
TypeName resultBuilderType = builderType(processFunction.resultDataType(true));
|
||||
builder.beginControlFlow(
|
||||
"try ($T builder = driverContext.blockFactory().$L(positionCount))",
|
||||
resultBuilderType,
|
||||
|
@ -196,7 +213,7 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.addStatement("BytesRef $N = new BytesRef()", scratchPadName);
|
||||
}
|
||||
|
||||
String appendMethod = appendMethod(resultType);
|
||||
String appendMethod = processFunction.appendMethod();
|
||||
builder.beginControlFlow("for (int p = 0; p < positionCount; p++)");
|
||||
{
|
||||
builder.addStatement("int valueCount = block.getValueCount(p)");
|
||||
|
@ -204,11 +221,10 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.addStatement("int end = start + valueCount");
|
||||
builder.addStatement("boolean positionOpened = false");
|
||||
builder.addStatement("boolean valuesAppended = false");
|
||||
// builder.addStatement("builder.beginPositionEntry()");
|
||||
builder.beginControlFlow("for (int i = start; i < end; i++)");
|
||||
{
|
||||
catchingWarnExceptions(builder, () -> {
|
||||
builder.addStatement("$T value = $N", resultType, evalValueCall("block", "i", scratchPadName));
|
||||
builder.addStatement("$T value = $N", processFunction.returnType(), evalValueCall("block", "i", scratchPadName));
|
||||
builder.beginControlFlow("if (positionOpened == false && valueCount > 1)");
|
||||
{
|
||||
builder.addStatement("builder.beginPositionEntry()");
|
||||
|
@ -253,8 +269,8 @@ public class ConvertEvaluatorImplementer {
|
|||
|
||||
private MethodSpec evalValue(boolean forVector) {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("evalValue")
|
||||
.addModifiers(Modifier.PRIVATE, Modifier.STATIC)
|
||||
.returns(resultType);
|
||||
.addModifiers(Modifier.PRIVATE)
|
||||
.returns(processFunction.returnType());
|
||||
|
||||
if (forVector) {
|
||||
builder.addParameter(vectorType(argumentType), "container");
|
||||
|
@ -269,8 +285,17 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.addStatement("$T value = container.$N(index)", argumentType, getMethod(argumentType));
|
||||
}
|
||||
|
||||
builder.addStatement("return $T.$N(value)", declarationType, processFunction.getSimpleName());
|
||||
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<Object> args = new ArrayList<>();
|
||||
pattern.append("return $T.$N(value");
|
||||
args.add(declarationType);
|
||||
args.add(processFunction.function.getSimpleName());
|
||||
for (int a = 1; a < processFunction.args.size(); a++) {
|
||||
pattern.append(", ");
|
||||
processFunction.args.get(a).buildInvocation(pattern, args, false /* block style parameter should be unused */);
|
||||
}
|
||||
pattern.append(")");
|
||||
builder.addStatement(pattern.toString(), args.toArray());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
@ -280,42 +305,11 @@ public class ConvertEvaluatorImplementer {
|
|||
builder.addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||
|
||||
builder.addField(SOURCE, "source", Modifier.PRIVATE, Modifier.FINAL);
|
||||
builder.addField(EXPRESSION_EVALUATOR_FACTORY, "field", Modifier.PRIVATE, Modifier.FINAL);
|
||||
processFunction.args.forEach(a -> a.declareFactoryField(builder));
|
||||
|
||||
builder.addMethod(factoryCtor());
|
||||
builder.addMethod(factoryGet());
|
||||
builder.addMethod(factoryToString());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec factoryCtor() {
|
||||
MethodSpec.Builder builder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(EXPRESSION_EVALUATOR_FACTORY, "field");
|
||||
builder.addParameter(SOURCE, "source");
|
||||
builder.addStatement("this.field = field");
|
||||
builder.addStatement("this.source = source");
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec factoryGet() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("get").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(DRIVER_CONTEXT, "context");
|
||||
builder.returns(implementation);
|
||||
|
||||
List<String> args = new ArrayList<>();
|
||||
args.add("field.get(context)");
|
||||
args.add("source");
|
||||
args.add("context");
|
||||
builder.addStatement("return new $T($L)", implementation, args.stream().collect(Collectors.joining(", ")));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec factoryToString() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("toString").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
builder.returns(String.class);
|
||||
builder.addStatement("return $S + field + $S", declarationType.getSimpleName() + extraName + "Evaluator[field=", "]");
|
||||
builder.addMethod(processFunction.factoryCtor());
|
||||
builder.addMethod(processFunction.factoryGet(implementation));
|
||||
builder.addMethod(processFunction.toStringMethod(implementation));
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.elasticsearch.compute.ann.Fixed.Scope;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -33,7 +34,6 @@ import javax.lang.model.type.TypeKind;
|
|||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.lang.model.util.Elements;
|
||||
|
||||
import static org.elasticsearch.compute.gen.Methods.appendMethod;
|
||||
import static org.elasticsearch.compute.gen.Methods.buildFromFactory;
|
||||
import static org.elasticsearch.compute.gen.Methods.getMethod;
|
||||
import static org.elasticsearch.compute.gen.Types.BLOCK;
|
||||
|
@ -71,7 +71,7 @@ public class EvaluatorImplementer {
|
|||
List<TypeMirror> warnExceptions
|
||||
) {
|
||||
this.declarationType = (TypeElement) processFunction.getEnclosingElement();
|
||||
this.processFunction = new ProcessFunction(elements, types, processFunction, warnExceptions);
|
||||
this.processFunction = new ProcessFunction(types, processFunction, warnExceptions);
|
||||
|
||||
this.implementation = ClassName.get(
|
||||
elements.getPackageOf(declarationType).toString(),
|
||||
|
@ -99,7 +99,7 @@ public class EvaluatorImplementer {
|
|||
builder.addType(factory());
|
||||
|
||||
builder.addField(SOURCE, "source", Modifier.PRIVATE, Modifier.FINAL);
|
||||
processFunction.args.stream().forEach(a -> a.declareField(builder));
|
||||
processFunction.args.forEach(a -> a.declareField(builder));
|
||||
builder.addField(DRIVER_CONTEXT, "driverContext", Modifier.PRIVATE, Modifier.FINAL);
|
||||
|
||||
builder.addField(WARNINGS, "warnings", Modifier.PRIVATE);
|
||||
|
@ -117,8 +117,8 @@ public class EvaluatorImplementer {
|
|||
}
|
||||
builder.addMethod(realEval(false));
|
||||
}
|
||||
builder.addMethod(toStringMethod());
|
||||
builder.addMethod(close());
|
||||
builder.addMethod(processFunction.toStringMethod(implementation));
|
||||
builder.addMethod(processFunction.close());
|
||||
builder.addMethod(warnings());
|
||||
return builder.build();
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ public class EvaluatorImplementer {
|
|||
String builtPattern;
|
||||
if (processFunction.builderArg == null) {
|
||||
builtPattern = vectorize ? "result.$L(p, " + pattern + ")" : "result.$L(" + pattern + ")";
|
||||
args.add(0, appendMethod(resultDataType));
|
||||
args.add(0, processFunction.appendMethod());
|
||||
} else {
|
||||
builtPattern = pattern.toString();
|
||||
}
|
||||
|
@ -290,35 +290,6 @@ public class EvaluatorImplementer {
|
|||
builder.endControlFlow();
|
||||
}
|
||||
|
||||
private MethodSpec toStringMethod() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("toString").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC).returns(String.class);
|
||||
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<Object> args = new ArrayList<>();
|
||||
pattern.append("return $S");
|
||||
args.add(implementation.simpleName() + "[");
|
||||
processFunction.args.stream().forEach(a -> a.buildToStringInvocation(pattern, args, args.size() > 2 ? ", " : ""));
|
||||
pattern.append(" + $S");
|
||||
args.add("]");
|
||||
builder.addStatement(pattern.toString(), args.toArray());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec close() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("close").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
|
||||
List<String> invocations = processFunction.args.stream().map(ProcessFunctionArg::closeInvocation).filter(s -> s != null).toList();
|
||||
if (invocations.isEmpty() == false) {
|
||||
builder.addStatement(
|
||||
"$T.closeExpectNoException(" + invocations.stream().collect(Collectors.joining(", ")) + ")",
|
||||
Types.RELEASABLES
|
||||
);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
static MethodSpec warnings() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("warnings");
|
||||
builder.addModifiers(Modifier.PRIVATE).returns(WARNINGS);
|
||||
|
@ -343,42 +314,14 @@ public class EvaluatorImplementer {
|
|||
builder.addField(SOURCE, "source", Modifier.PRIVATE, Modifier.FINAL);
|
||||
processFunction.args.stream().forEach(a -> a.declareFactoryField(builder));
|
||||
|
||||
builder.addMethod(factoryCtor());
|
||||
builder.addMethod(factoryGet());
|
||||
builder.addMethod(toStringMethod());
|
||||
builder.addMethod(processFunction.factoryCtor());
|
||||
builder.addMethod(processFunction.factoryGet(implementation));
|
||||
builder.addMethod(processFunction.toStringMethod(implementation));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec factoryCtor() {
|
||||
MethodSpec.Builder builder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(SOURCE, "source");
|
||||
builder.addStatement("this.source = source");
|
||||
processFunction.args.stream().forEach(a -> a.implementFactoryCtor(builder));
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private MethodSpec factoryGet() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("get").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(DRIVER_CONTEXT, "context");
|
||||
builder.returns(implementation);
|
||||
|
||||
List<String> args = new ArrayList<>();
|
||||
args.add("source");
|
||||
for (ProcessFunctionArg arg : processFunction.args) {
|
||||
String invocation = arg.factoryInvocation(builder);
|
||||
if (invocation != null) {
|
||||
args.add(invocation);
|
||||
}
|
||||
}
|
||||
args.add("context");
|
||||
builder.addStatement("return new $T($L)", implementation, args.stream().collect(Collectors.joining(", ")));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private interface ProcessFunctionArg {
|
||||
interface ProcessFunctionArg {
|
||||
/**
|
||||
* Type containing the actual data for a page of values for this field. Usually a
|
||||
* Block or Vector, but for fixed fields will be the original fixed type.
|
||||
|
@ -470,7 +413,7 @@ public class EvaluatorImplementer {
|
|||
String closeInvocation();
|
||||
}
|
||||
|
||||
private record StandardProcessFunctionArg(TypeName type, String name) implements ProcessFunctionArg {
|
||||
record StandardProcessFunctionArg(TypeName type, String name) implements ProcessFunctionArg {
|
||||
@Override
|
||||
public TypeName dataType(boolean blockStyle) {
|
||||
if (blockStyle) {
|
||||
|
@ -726,7 +669,7 @@ public class EvaluatorImplementer {
|
|||
}
|
||||
}
|
||||
|
||||
private record FixedProcessFunctionArg(TypeName type, String name, boolean includeInToString, Scope scope, boolean releasable)
|
||||
record FixedProcessFunctionArg(TypeName type, String name, boolean includeInToString, Scope scope, boolean releasable)
|
||||
implements
|
||||
ProcessFunctionArg {
|
||||
@Override
|
||||
|
@ -999,20 +942,15 @@ public class EvaluatorImplementer {
|
|||
}
|
||||
}
|
||||
|
||||
private static class ProcessFunction {
|
||||
private final ExecutableElement function;
|
||||
private final List<ProcessFunctionArg> args;
|
||||
static class ProcessFunction {
|
||||
final ExecutableElement function;
|
||||
final List<ProcessFunctionArg> args;
|
||||
private final BuilderProcessFunctionArg builderArg;
|
||||
private final List<TypeMirror> warnExceptions;
|
||||
|
||||
private boolean hasBlockType;
|
||||
|
||||
private ProcessFunction(
|
||||
Elements elements,
|
||||
javax.lang.model.util.Types types,
|
||||
ExecutableElement function,
|
||||
List<TypeMirror> warnExceptions
|
||||
) {
|
||||
ProcessFunction(javax.lang.model.util.Types types, ExecutableElement function, List<TypeMirror> warnExceptions) {
|
||||
this.function = function;
|
||||
args = new ArrayList<>();
|
||||
BuilderProcessFunctionArg builderArg = null;
|
||||
|
@ -1063,12 +1001,89 @@ public class EvaluatorImplementer {
|
|||
this.warnExceptions = warnExceptions;
|
||||
}
|
||||
|
||||
private ClassName resultDataType(boolean blockStyle) {
|
||||
TypeName returnType() {
|
||||
return TypeName.get(function.getReturnType());
|
||||
}
|
||||
|
||||
ClassName resultDataType(boolean blockStyle) {
|
||||
if (builderArg != null) {
|
||||
return builderArg.type.enclosingClassName();
|
||||
}
|
||||
boolean useBlockStyle = blockStyle || warnExceptions.isEmpty() == false;
|
||||
return useBlockStyle ? blockType(TypeName.get(function.getReturnType())) : vectorType(TypeName.get(function.getReturnType()));
|
||||
return useBlockStyle ? blockType(returnType()) : vectorType(returnType());
|
||||
}
|
||||
|
||||
String appendMethod() {
|
||||
return Methods.appendMethod(returnType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProcessFunction{"
|
||||
+ "function="
|
||||
+ function
|
||||
+ ", args="
|
||||
+ args
|
||||
+ ", builderArg="
|
||||
+ builderArg
|
||||
+ ", warnExceptions="
|
||||
+ warnExceptions
|
||||
+ ", hasBlockType="
|
||||
+ hasBlockType
|
||||
+ '}';
|
||||
}
|
||||
|
||||
MethodSpec toStringMethod(ClassName implementation) {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("toString").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC).returns(String.class);
|
||||
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<Object> args = new ArrayList<>();
|
||||
pattern.append("return $S");
|
||||
args.add(implementation.simpleName() + "[");
|
||||
this.args.forEach(a -> a.buildToStringInvocation(pattern, args, args.size() > 2 ? ", " : ""));
|
||||
pattern.append(" + $S");
|
||||
args.add("]");
|
||||
builder.addStatement(pattern.toString(), args.toArray());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
MethodSpec factoryCtor() {
|
||||
MethodSpec.Builder builder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(SOURCE, "source");
|
||||
builder.addStatement("this.source = source");
|
||||
args.stream().forEach(a -> a.implementFactoryCtor(builder));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
MethodSpec factoryGet(ClassName implementation) {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("get").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
builder.addParameter(DRIVER_CONTEXT, "context");
|
||||
builder.returns(implementation);
|
||||
|
||||
List<String> args = new ArrayList<>();
|
||||
args.add("source");
|
||||
for (ProcessFunctionArg arg : this.args) {
|
||||
String invocation = arg.factoryInvocation(builder);
|
||||
if (invocation != null) {
|
||||
args.add(invocation);
|
||||
}
|
||||
}
|
||||
args.add("context");
|
||||
builder.addStatement("return new $T($L)", implementation, String.join(", ", args));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
MethodSpec close() {
|
||||
MethodSpec.Builder builder = MethodSpec.methodBuilder("close").addAnnotation(Override.class);
|
||||
builder.addModifiers(Modifier.PUBLIC);
|
||||
|
||||
List<String> invocations = args.stream().map(ProcessFunctionArg::closeInvocation).filter(Objects::nonNull).toList();
|
||||
if (invocations.isEmpty() == false) {
|
||||
builder.addStatement("$T.closeExpectNoException(" + String.join(", ", invocations) + ")", Types.RELEASABLES);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ public class EvaluatorProcessor implements Processor {
|
|||
"evaluator",
|
||||
new ConvertEvaluatorImplementer(
|
||||
env.getElementUtils(),
|
||||
env.getTypeUtils(),
|
||||
(ExecutableElement) evaluatorMethod,
|
||||
convertEvaluatorAnn.extraName(),
|
||||
warnExceptionsTypes
|
||||
|
|
|
@ -1403,6 +1403,20 @@ emp_no:integer | first_name:keyword | name_lower:keyword
|
|||
;
|
||||
|
||||
|
||||
toLowerMv
|
||||
required_capability: to_lower_mv
|
||||
// tag::to_lower_mv[]
|
||||
ROW v = TO_LOWER(["Some", "Text"])
|
||||
// end::to_lower_mv[]
|
||||
;
|
||||
|
||||
// tag::to_lower_mv-result[]
|
||||
v:keyword
|
||||
["some", "text"]
|
||||
// end::to_lower_mv-result[]
|
||||
;
|
||||
|
||||
|
||||
toUpperRow#[skip:-8.12.99]
|
||||
// tag::to_upper[]
|
||||
ROW message = "Some Text"
|
||||
|
@ -1425,6 +1439,20 @@ emp_no:integer | first_name:keyword | name_upper:keyword
|
|||
;
|
||||
|
||||
|
||||
toUpperMv
|
||||
required_capability: to_lower_mv
|
||||
// tag::to_upper_mv[]
|
||||
ROW v = TO_UPPER(["Some", "Text"])
|
||||
// end::to_upper_mv[]
|
||||
;
|
||||
|
||||
// tag::to_upper_mv-result[]
|
||||
v:keyword
|
||||
["SOME", "TEXT"]
|
||||
// end::to_upper_mv-result[]
|
||||
;
|
||||
|
||||
|
||||
toUpperLowerUnicode#[skip:-8.12.99]
|
||||
row a = "π/2 + a + B + Λ ºC" | eval lower = to_lower(a), upper = to_upper(a) | keep a, upper, lower;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.DoubleVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToBooleanFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToBooleanFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator d;
|
||||
|
||||
public ToBooleanFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator d,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.d = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToBooleanFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToBooleanFromDoubleEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(DoubleVector container, int index) {
|
||||
private boolean evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToBoolean.fromDouble(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToBooleanFromDoubleEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(DoubleBlock container, int index) {
|
||||
private boolean evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToBoolean.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromDoubleEvaluator[" + "d=" + d + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(d);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory d;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory d) {
|
||||
this.source = source;
|
||||
this.d = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToBooleanFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToBooleanFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToBooleanFromDoubleEvaluator(source, d.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToBooleanFromDoubleEvaluator[" + "d=" + d + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToBooleanFromIntEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToBooleanFromIntEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator i;
|
||||
|
||||
public ToBooleanFromIntEvaluator(Source source, EvalOperator.ExpressionEvaluator i,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToBooleanFromInt";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToBooleanFromIntEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(IntVector container, int index) {
|
||||
private boolean evalValue(IntVector container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToBoolean.fromInt(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToBooleanFromIntEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(IntBlock container, int index) {
|
||||
private boolean evalValue(IntBlock container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToBoolean.fromInt(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(i);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory i;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory i) {
|
||||
this.source = source;
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToBooleanFromIntEvaluator get(DriverContext context) {
|
||||
return new ToBooleanFromIntEvaluator(field.get(context), source, context);
|
||||
return new ToBooleanFromIntEvaluator(source, i.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromIntEvaluator[field=" + field + "]";
|
||||
return "ToBooleanFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToBooleanFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToBooleanFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator l;
|
||||
|
||||
public ToBooleanFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator l,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToBooleanFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToBooleanFromLongEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(LongVector container, int index) {
|
||||
private boolean evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToBoolean.fromLong(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToBooleanFromLongEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(LongBlock container, int index) {
|
||||
private boolean evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToBoolean.fromLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(l);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory l;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory l) {
|
||||
this.source = source;
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToBooleanFromLongEvaluator get(DriverContext context) {
|
||||
return new ToBooleanFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToBooleanFromLongEvaluator(source, l.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromLongEvaluator[field=" + field + "]";
|
||||
return "ToBooleanFromLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToBooleanFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToBooleanFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator keyword;
|
||||
|
||||
public ToBooleanFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator keyword,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToBooleanFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,7 +51,7 @@ public final class ToBooleanFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private boolean evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToBoolean.fromKeyword(value);
|
||||
}
|
||||
|
@ -83,29 +87,39 @@ public final class ToBooleanFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private boolean evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToBoolean.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromStringEvaluator[" + "keyword=" + keyword + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(keyword);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory keyword;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory keyword) {
|
||||
this.source = source;
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToBooleanFromStringEvaluator get(DriverContext context) {
|
||||
return new ToBooleanFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToBooleanFromStringEvaluator(source, keyword.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromStringEvaluator[field=" + field + "]";
|
||||
return "ToBooleanFromStringEvaluator[" + "keyword=" + keyword + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToBooleanFromUnsignedLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToBooleanFromUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator ul;
|
||||
|
||||
public ToBooleanFromUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator ul,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToBooleanFromUnsignedLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToBooleanFromUnsignedLongEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(LongVector container, int index) {
|
||||
private boolean evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToBoolean.fromUnsignedLong(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToBooleanFromUnsignedLongEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean evalValue(LongBlock container, int index) {
|
||||
private boolean evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToBoolean.fromUnsignedLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(ul);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory ul;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory ul) {
|
||||
this.source = source;
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToBooleanFromUnsignedLongEvaluator get(DriverContext context) {
|
||||
return new ToBooleanFromUnsignedLongEvaluator(field.get(context), source, context);
|
||||
return new ToBooleanFromUnsignedLongEvaluator(source, ul.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToBooleanFromUnsignedLongEvaluator[field=" + field + "]";
|
||||
return "ToBooleanFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToCartesianPointFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToCartesianPointFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToCartesianPointFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToCartesianPointFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToCartesianPointFromStringEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToCartesianPoint.fromKeyword(value);
|
||||
}
|
||||
|
@ -97,29 +101,39 @@ public final class ToCartesianPointFromStringEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToCartesianPoint.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToCartesianPointFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToCartesianPointFromStringEvaluator get(DriverContext context) {
|
||||
return new ToCartesianPointFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToCartesianPointFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToCartesianPointFromStringEvaluator[field=" + field + "]";
|
||||
return "ToCartesianPointFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToCartesianShapeFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToCartesianShapeFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToCartesianShapeFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToCartesianShapeFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToCartesianShapeFromStringEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToCartesianShape.fromKeyword(value);
|
||||
}
|
||||
|
@ -97,29 +101,39 @@ public final class ToCartesianShapeFromStringEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToCartesianShape.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToCartesianShapeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToCartesianShapeFromStringEvaluator get(DriverContext context) {
|
||||
return new ToCartesianShapeFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToCartesianShapeFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToCartesianShapeFromStringEvaluator[field=" + field + "]";
|
||||
return "ToCartesianShapeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDateNanosFromDatetimeEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDateNanosFromDatetimeEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDateNanosFromDatetimeEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDateNanosFromDatetime";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToDateNanosFromDatetimeEvaluator extends AbstractConvertFunct
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongVector container, int index) {
|
||||
private long evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDateNanos.fromDatetime(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToDateNanosFromDatetimeEvaluator extends AbstractConvertFunct
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongBlock container, int index) {
|
||||
private long evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDateNanos.fromDatetime(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromDatetimeEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDateNanosFromDatetimeEvaluator get(DriverContext context) {
|
||||
return new ToDateNanosFromDatetimeEvaluator(field.get(context), source, context);
|
||||
return new ToDateNanosFromDatetimeEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromDatetimeEvaluator[field=" + field + "]";
|
||||
return "ToDateNanosFromDatetimeEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDateNanosFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDateNanosFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDateNanosFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDateNanosFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToDateNanosFromDoubleEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleVector container, int index) {
|
||||
private long evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToDateNanos.fromDouble(value);
|
||||
}
|
||||
|
@ -96,29 +100,39 @@ public final class ToDateNanosFromDoubleEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleBlock container, int index) {
|
||||
private long evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToDateNanos.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromDoubleEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDateNanosFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToDateNanosFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToDateNanosFromDoubleEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToDateNanosFromDoubleEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDateNanosFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDateNanosFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDateNanosFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDateNanosFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToDateNanosFromLongEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongVector container, int index) {
|
||||
private long evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDateNanos.fromLong(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToDateNanosFromLongEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongBlock container, int index) {
|
||||
private long evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDateNanos.fromLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromLongEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDateNanosFromLongEvaluator get(DriverContext context) {
|
||||
return new ToDateNanosFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToDateNanosFromLongEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromLongEvaluator[field=" + field + "]";
|
||||
return "ToDateNanosFromLongEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDateNanosFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDateNanosFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDateNanosFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDateNanosFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class ToDateNanosFromStringEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDateNanos.fromKeyword(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class ToDateNanosFromStringEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDateNanos.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDateNanosFromStringEvaluator get(DriverContext context) {
|
||||
return new ToDateNanosFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToDateNanosFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDateNanosFromStringEvaluator[field=" + field + "]";
|
||||
return "ToDateNanosFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDatetimeFromDateNanosEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDatetimeFromDateNanosEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDatetimeFromDateNanosEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDatetimeFromDateNanos";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToDatetimeFromDateNanosEvaluator extends AbstractConvertFunct
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongVector container, int index) {
|
||||
private long evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDatetime.fromDatenanos(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToDatetimeFromDateNanosEvaluator extends AbstractConvertFunct
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongBlock container, int index) {
|
||||
private long evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDatetime.fromDatenanos(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDatetimeFromDateNanosEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDatetimeFromDateNanosEvaluator get(DriverContext context) {
|
||||
return new ToDatetimeFromDateNanosEvaluator(field.get(context), source, context);
|
||||
return new ToDatetimeFromDateNanosEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDatetimeFromDateNanosEvaluator[field=" + field + "]";
|
||||
return "ToDatetimeFromDateNanosEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDatetimeFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDatetimeFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDatetimeFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDatetimeFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class ToDatetimeFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDatetime.fromKeyword(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class ToDatetimeFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDatetime.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDatetimeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDatetimeFromStringEvaluator get(DriverContext context) {
|
||||
return new ToDatetimeFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToDatetimeFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDatetimeFromStringEvaluator[field=" + field + "]";
|
||||
return "ToDatetimeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.DoubleVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDegreesEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDegreesEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator deg;
|
||||
|
||||
public ToDegreesEvaluator(Source source, EvalOperator.ExpressionEvaluator deg,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.deg = deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDegrees";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToDegreesEvaluator extends AbstractConvertFunction.AbstractEv
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(DoubleVector container, int index) {
|
||||
private double evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToDegrees.process(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToDegreesEvaluator extends AbstractConvertFunction.AbstractEv
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(DoubleBlock container, int index) {
|
||||
private double evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToDegrees.process(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDegreesEvaluator[" + "deg=" + deg + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(deg);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory deg;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory deg) {
|
||||
this.source = source;
|
||||
this.deg = deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDegreesEvaluator get(DriverContext context) {
|
||||
return new ToDegreesEvaluator(field.get(context), source, context);
|
||||
return new ToDegreesEvaluator(source, deg.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDegreesEvaluator[field=" + field + "]";
|
||||
return "ToDegreesEvaluator[" + "deg=" + deg + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDoubleFromBooleanEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDoubleFromBooleanEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator bool;
|
||||
|
||||
public ToDoubleFromBooleanEvaluator(Source source, EvalOperator.ExpressionEvaluator bool,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDoubleFromBoolean";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToDoubleFromBooleanEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BooleanVector container, int index) {
|
||||
private double evalValue(BooleanVector container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToDouble.fromBoolean(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToDoubleFromBooleanEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BooleanBlock container, int index) {
|
||||
private double evalValue(BooleanBlock container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToDouble.fromBoolean(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(bool);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory bool;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory bool) {
|
||||
this.source = source;
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDoubleFromBooleanEvaluator get(DriverContext context) {
|
||||
return new ToDoubleFromBooleanEvaluator(field.get(context), source, context);
|
||||
return new ToDoubleFromBooleanEvaluator(source, bool.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromBooleanEvaluator[field=" + field + "]";
|
||||
return "ToDoubleFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDoubleFromIntEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDoubleFromIntEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator i;
|
||||
|
||||
public ToDoubleFromIntEvaluator(Source source, EvalOperator.ExpressionEvaluator i,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDoubleFromInt";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToDoubleFromIntEvaluator extends AbstractConvertFunction.Abst
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(IntVector container, int index) {
|
||||
private double evalValue(IntVector container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToDouble.fromInt(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToDoubleFromIntEvaluator extends AbstractConvertFunction.Abst
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(IntBlock container, int index) {
|
||||
private double evalValue(IntBlock container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToDouble.fromInt(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(i);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory i;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory i) {
|
||||
this.source = source;
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDoubleFromIntEvaluator get(DriverContext context) {
|
||||
return new ToDoubleFromIntEvaluator(field.get(context), source, context);
|
||||
return new ToDoubleFromIntEvaluator(source, i.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromIntEvaluator[field=" + field + "]";
|
||||
return "ToDoubleFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDoubleFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDoubleFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator l;
|
||||
|
||||
public ToDoubleFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator l,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDoubleFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToDoubleFromLongEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(LongVector container, int index) {
|
||||
private double evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDouble.fromLong(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToDoubleFromLongEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(LongBlock container, int index) {
|
||||
private double evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDouble.fromLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(l);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory l;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory l) {
|
||||
this.source = source;
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDoubleFromLongEvaluator get(DriverContext context) {
|
||||
return new ToDoubleFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToDoubleFromLongEvaluator(source, l.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromLongEvaluator[field=" + field + "]";
|
||||
return "ToDoubleFromLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDoubleFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDoubleFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToDoubleFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDoubleFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class ToDoubleFromStringEvaluator extends AbstractConvertFunction.A
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDouble.fromKeyword(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class ToDoubleFromStringEvaluator extends AbstractConvertFunction.A
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToDouble.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDoubleFromStringEvaluator get(DriverContext context) {
|
||||
return new ToDoubleFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToDoubleFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromStringEvaluator[field=" + field + "]";
|
||||
return "ToDoubleFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToDoubleFromUnsignedLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToDoubleFromUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator l;
|
||||
|
||||
public ToDoubleFromUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator l,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToDoubleFromUnsignedLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToDoubleFromUnsignedLongEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(LongVector container, int index) {
|
||||
private double evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDouble.fromUnsignedLong(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToDoubleFromUnsignedLongEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(LongBlock container, int index) {
|
||||
private double evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToDouble.fromUnsignedLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromUnsignedLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(l);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory l;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory l) {
|
||||
this.source = source;
|
||||
this.l = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToDoubleFromUnsignedLongEvaluator get(DriverContext context) {
|
||||
return new ToDoubleFromUnsignedLongEvaluator(field.get(context), source, context);
|
||||
return new ToDoubleFromUnsignedLongEvaluator(source, l.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToDoubleFromUnsignedLongEvaluator[field=" + field + "]";
|
||||
return "ToDoubleFromUnsignedLongEvaluator[" + "l=" + l + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToGeoPointFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToGeoPointFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToGeoPointFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToGeoPointFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToGeoPointFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToGeoPoint.fromKeyword(value);
|
||||
}
|
||||
|
@ -97,29 +101,39 @@ public final class ToGeoPointFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToGeoPoint.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToGeoPointFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToGeoPointFromStringEvaluator get(DriverContext context) {
|
||||
return new ToGeoPointFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToGeoPointFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToGeoPointFromStringEvaluator[field=" + field + "]";
|
||||
return "ToGeoPointFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToGeoShapeFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToGeoShapeFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToGeoShapeFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToGeoShapeFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToGeoShapeFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToGeoShape.fromKeyword(value);
|
||||
}
|
||||
|
@ -97,29 +101,39 @@ public final class ToGeoShapeFromStringEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToGeoShape.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToGeoShapeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToGeoShapeFromStringEvaluator get(DriverContext context) {
|
||||
return new ToGeoShapeFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToGeoShapeFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToGeoShapeFromStringEvaluator[field=" + field + "]";
|
||||
return "ToGeoShapeFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIPFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIPFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator asString;
|
||||
|
||||
public ToIPFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator asString,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.asString = asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIPFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +61,7 @@ public final class ToIPFromStringEvaluator extends AbstractConvertFunction.Abstr
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToIP.fromKeyword(value);
|
||||
}
|
||||
|
@ -97,29 +101,39 @@ public final class ToIPFromStringEvaluator extends AbstractConvertFunction.Abstr
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToIP.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIPFromStringEvaluator[" + "asString=" + asString + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(asString);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory asString;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory asString) {
|
||||
this.source = source;
|
||||
this.asString = asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIPFromStringEvaluator get(DriverContext context) {
|
||||
return new ToIPFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToIPFromStringEvaluator(source, asString.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIPFromStringEvaluator[field=" + field + "]";
|
||||
return "ToIPFromStringEvaluator[" + "asString=" + asString + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIntegerFromBooleanEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIntegerFromBooleanEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator bool;
|
||||
|
||||
public ToIntegerFromBooleanEvaluator(Source source, EvalOperator.ExpressionEvaluator bool,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIntegerFromBoolean";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToIntegerFromBooleanEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(BooleanVector container, int index) {
|
||||
private int evalValue(BooleanVector container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToInteger.fromBoolean(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToIntegerFromBooleanEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(BooleanBlock container, int index) {
|
||||
private int evalValue(BooleanBlock container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToInteger.fromBoolean(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(bool);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory bool;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory bool) {
|
||||
this.source = source;
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIntegerFromBooleanEvaluator get(DriverContext context) {
|
||||
return new ToIntegerFromBooleanEvaluator(field.get(context), source, context);
|
||||
return new ToIntegerFromBooleanEvaluator(source, bool.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromBooleanEvaluator[field=" + field + "]";
|
||||
return "ToIntegerFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIntegerFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIntegerFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator dbl;
|
||||
|
||||
public ToIntegerFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator dbl,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIntegerFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToIntegerFromDoubleEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(DoubleVector container, int index) {
|
||||
private int evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToInteger.fromDouble(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToIntegerFromDoubleEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(DoubleBlock container, int index) {
|
||||
private int evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToInteger.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(dbl);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory dbl;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory dbl) {
|
||||
this.source = source;
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIntegerFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToIntegerFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToIntegerFromDoubleEvaluator(source, dbl.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToIntegerFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIntegerFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIntegerFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator lng;
|
||||
|
||||
public ToIntegerFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator lng,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIntegerFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToIntegerFromLongEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(LongVector container, int index) {
|
||||
private int evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToInteger.fromLong(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToIntegerFromLongEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(LongBlock container, int index) {
|
||||
private int evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToInteger.fromLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(lng);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory lng;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory lng) {
|
||||
this.source = source;
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIntegerFromLongEvaluator get(DriverContext context) {
|
||||
return new ToIntegerFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToIntegerFromLongEvaluator(source, lng.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromLongEvaluator[field=" + field + "]";
|
||||
return "ToIntegerFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.IntBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIntegerFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIntegerFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToIntegerFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIntegerFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class ToIntegerFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private int evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToInteger.fromKeyword(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class ToIntegerFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private int evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToInteger.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIntegerFromStringEvaluator get(DriverContext context) {
|
||||
return new ToIntegerFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToIntegerFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromStringEvaluator[field=" + field + "]";
|
||||
return "ToIntegerFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToIntegerFromUnsignedLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToIntegerFromUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator ul;
|
||||
|
||||
public ToIntegerFromUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator ul,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToIntegerFromUnsignedLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToIntegerFromUnsignedLongEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(LongVector container, int index) {
|
||||
private int evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToInteger.fromUnsignedLong(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToIntegerFromUnsignedLongEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static int evalValue(LongBlock container, int index) {
|
||||
private int evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToInteger.fromUnsignedLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(ul);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory ul;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory ul) {
|
||||
this.source = source;
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToIntegerFromUnsignedLongEvaluator get(DriverContext context) {
|
||||
return new ToIntegerFromUnsignedLongEvaluator(field.get(context), source, context);
|
||||
return new ToIntegerFromUnsignedLongEvaluator(source, ul.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToIntegerFromUnsignedLongEvaluator[field=" + field + "]";
|
||||
return "ToIntegerFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToLongFromBooleanEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToLongFromBooleanEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator bool;
|
||||
|
||||
public ToLongFromBooleanEvaluator(Source source, EvalOperator.ExpressionEvaluator bool,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToLongFromBoolean";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToLongFromBooleanEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BooleanVector container, int index) {
|
||||
private long evalValue(BooleanVector container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToLong.fromBoolean(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToLongFromBooleanEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BooleanBlock container, int index) {
|
||||
private long evalValue(BooleanBlock container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToLong.fromBoolean(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(bool);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory bool;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory bool) {
|
||||
this.source = source;
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToLongFromBooleanEvaluator get(DriverContext context) {
|
||||
return new ToLongFromBooleanEvaluator(field.get(context), source, context);
|
||||
return new ToLongFromBooleanEvaluator(source, bool.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromBooleanEvaluator[field=" + field + "]";
|
||||
return "ToLongFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToLongFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToLongFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator dbl;
|
||||
|
||||
public ToLongFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator dbl,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToLongFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToLongFromDoubleEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleVector container, int index) {
|
||||
private long evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToLong.fromDouble(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToLongFromDoubleEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleBlock container, int index) {
|
||||
private long evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToLong.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(dbl);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory dbl;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory dbl) {
|
||||
this.source = source;
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToLongFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToLongFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToLongFromDoubleEvaluator(source, dbl.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToLongFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToLongFromIntEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToLongFromIntEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator i;
|
||||
|
||||
public ToLongFromIntEvaluator(Source source, EvalOperator.ExpressionEvaluator i,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToLongFromInt";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToLongFromIntEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(IntVector container, int index) {
|
||||
private long evalValue(IntVector container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToLong.fromInt(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToLongFromIntEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(IntBlock container, int index) {
|
||||
private long evalValue(IntBlock container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToLong.fromInt(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(i);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory i;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory i) {
|
||||
this.source = source;
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToLongFromIntEvaluator get(DriverContext context) {
|
||||
return new ToLongFromIntEvaluator(field.get(context), source, context);
|
||||
return new ToLongFromIntEvaluator(source, i.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromIntEvaluator[field=" + field + "]";
|
||||
return "ToLongFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToLongFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToLongFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToLongFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToLongFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class ToLongFromStringEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToLong.fromKeyword(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class ToLongFromStringEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToLong.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToLongFromStringEvaluator get(DriverContext context) {
|
||||
return new ToLongFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToLongFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromStringEvaluator[field=" + field + "]";
|
||||
return "ToLongFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToLongFromUnsignedLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToLongFromUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator ul;
|
||||
|
||||
public ToLongFromUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator ul,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToLongFromUnsignedLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToLongFromUnsignedLongEvaluator extends AbstractConvertFuncti
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongVector container, int index) {
|
||||
private long evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToLong.fromUnsignedLong(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToLongFromUnsignedLongEvaluator extends AbstractConvertFuncti
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongBlock container, int index) {
|
||||
private long evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToLong.fromUnsignedLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(ul);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory ul;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory ul) {
|
||||
this.source = source;
|
||||
this.ul = ul;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToLongFromUnsignedLongEvaluator get(DriverContext context) {
|
||||
return new ToLongFromUnsignedLongEvaluator(field.get(context), source, context);
|
||||
return new ToLongFromUnsignedLongEvaluator(source, ul.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToLongFromUnsignedLongEvaluator[field=" + field + "]";
|
||||
return "ToLongFromUnsignedLongEvaluator[" + "ul=" + ul + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -19,14 +20,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToRadiansEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToRadiansEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator deg;
|
||||
|
||||
public ToRadiansEvaluator(Source source, EvalOperator.ExpressionEvaluator deg,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.deg = deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToRadians";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,7 +48,7 @@ public final class ToRadiansEvaluator extends AbstractConvertFunction.AbstractEv
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(DoubleVector container, int index) {
|
||||
private double evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToRadians.process(value);
|
||||
}
|
||||
|
@ -79,29 +83,39 @@ public final class ToRadiansEvaluator extends AbstractConvertFunction.AbstractEv
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(DoubleBlock container, int index) {
|
||||
private double evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToRadians.process(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToRadiansEvaluator[" + "deg=" + deg + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(deg);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory deg;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory deg) {
|
||||
this.source = source;
|
||||
this.deg = deg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToRadiansEvaluator get(DriverContext context) {
|
||||
return new ToRadiansEvaluator(field.get(context), source, context);
|
||||
return new ToRadiansEvaluator(source, deg.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToRadiansEvaluator[field=" + field + "]";
|
||||
return "ToRadiansEvaluator[" + "deg=" + deg + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromBooleanEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromBooleanEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator bool;
|
||||
|
||||
public ToStringFromBooleanEvaluator(Source source, EvalOperator.ExpressionEvaluator bool,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromBoolean";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromBooleanEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BooleanVector container, int index) {
|
||||
private BytesRef evalValue(BooleanVector container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToString.fromBoolean(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromBooleanEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BooleanBlock container, int index) {
|
||||
private BytesRef evalValue(BooleanBlock container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToString.fromBoolean(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(bool);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory bool;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory bool) {
|
||||
this.source = source;
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromBooleanEvaluator get(DriverContext context) {
|
||||
return new ToStringFromBooleanEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromBooleanEvaluator(source, bool.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromBooleanEvaluator[field=" + field + "]";
|
||||
return "ToStringFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromCartesianPointEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromCartesianPointEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public ToStringFromCartesianPointEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromCartesianPoint";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromCartesianPointEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromCartesianPoint(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromCartesianPointEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromCartesianPoint(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromCartesianPointEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromCartesianPointEvaluator get(DriverContext context) {
|
||||
return new ToStringFromCartesianPointEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromCartesianPointEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromCartesianPointEvaluator[field=" + field + "]";
|
||||
return "ToStringFromCartesianPointEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromCartesianShapeEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromCartesianShapeEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public ToStringFromCartesianShapeEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromCartesianShape";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromCartesianShapeEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromCartesianShape(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromCartesianShapeEvaluator extends AbstractConvertFu
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromCartesianShape(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromCartesianShapeEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromCartesianShapeEvaluator get(DriverContext context) {
|
||||
return new ToStringFromCartesianShapeEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromCartesianShapeEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromCartesianShapeEvaluator[field=" + field + "]";
|
||||
return "ToStringFromCartesianShapeEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromDateNanosEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromDateNanosEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator datetime;
|
||||
|
||||
public ToStringFromDateNanosEvaluator(Source source, EvalOperator.ExpressionEvaluator datetime,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromDateNanos";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromDateNanosEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongVector container, int index) {
|
||||
private BytesRef evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDateNanos(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromDateNanosEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongBlock container, int index) {
|
||||
private BytesRef evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDateNanos(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDateNanosEvaluator[" + "datetime=" + datetime + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(datetime);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory datetime;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory datetime) {
|
||||
this.source = source;
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromDateNanosEvaluator get(DriverContext context) {
|
||||
return new ToStringFromDateNanosEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromDateNanosEvaluator(source, datetime.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDateNanosEvaluator[field=" + field + "]";
|
||||
return "ToStringFromDateNanosEvaluator[" + "datetime=" + datetime + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromDatetimeEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromDatetimeEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator datetime;
|
||||
|
||||
public ToStringFromDatetimeEvaluator(Source source, EvalOperator.ExpressionEvaluator datetime,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromDatetime";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromDatetimeEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongVector container, int index) {
|
||||
private BytesRef evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDatetime(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromDatetimeEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongBlock container, int index) {
|
||||
private BytesRef evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDatetime(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDatetimeEvaluator[" + "datetime=" + datetime + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(datetime);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory datetime;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory datetime) {
|
||||
this.source = source;
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromDatetimeEvaluator get(DriverContext context) {
|
||||
return new ToStringFromDatetimeEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromDatetimeEvaluator(source, datetime.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDatetimeEvaluator[field=" + field + "]";
|
||||
return "ToStringFromDatetimeEvaluator[" + "datetime=" + datetime + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.DoubleVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator dbl;
|
||||
|
||||
public ToStringFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator dbl,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromDoubleEvaluator extends AbstractConvertFunction.A
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(DoubleVector container, int index) {
|
||||
private BytesRef evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromDoubleEvaluator extends AbstractConvertFunction.A
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(DoubleBlock container, int index) {
|
||||
private BytesRef evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(dbl);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory dbl;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory dbl) {
|
||||
this.source = source;
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToStringFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromDoubleEvaluator(source, dbl.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToStringFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromGeoPointEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromGeoPointEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public ToStringFromGeoPointEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromGeoPoint";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromGeoPointEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromGeoPoint(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromGeoPointEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromGeoPoint(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromGeoPointEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromGeoPointEvaluator get(DriverContext context) {
|
||||
return new ToStringFromGeoPointEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromGeoPointEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromGeoPointEvaluator[field=" + field + "]";
|
||||
return "ToStringFromGeoPointEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromGeoShapeEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromGeoShapeEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public ToStringFromGeoShapeEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromGeoShape";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromGeoShapeEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromGeoShape(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromGeoShapeEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromGeoShape(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromGeoShapeEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromGeoShapeEvaluator get(DriverContext context) {
|
||||
return new ToStringFromGeoShapeEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromGeoShapeEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromGeoShapeEvaluator[field=" + field + "]";
|
||||
return "ToStringFromGeoShapeEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromIPEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromIPEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator ip;
|
||||
|
||||
public ToStringFromIPEvaluator(Source source, EvalOperator.ExpressionEvaluator ip,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromIP";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromIPEvaluator extends AbstractConvertFunction.Abstr
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromIP(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromIPEvaluator extends AbstractConvertFunction.Abstr
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromIP(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromIPEvaluator[" + "ip=" + ip + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(ip);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory ip;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory ip) {
|
||||
this.source = source;
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromIPEvaluator get(DriverContext context) {
|
||||
return new ToStringFromIPEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromIPEvaluator(source, ip.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromIPEvaluator[field=" + field + "]";
|
||||
return "ToStringFromIPEvaluator[" + "ip=" + ip + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.IntVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromIntEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromIntEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator integer;
|
||||
|
||||
public ToStringFromIntEvaluator(Source source, EvalOperator.ExpressionEvaluator integer,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromInt";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromIntEvaluator extends AbstractConvertFunction.Abst
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(IntVector container, int index) {
|
||||
private BytesRef evalValue(IntVector container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromIntEvaluator extends AbstractConvertFunction.Abst
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(IntBlock container, int index) {
|
||||
private BytesRef evalValue(IntBlock container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromIntEvaluator[" + "integer=" + integer + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(integer);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory integer;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory integer) {
|
||||
this.source = source;
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromIntEvaluator get(DriverContext context) {
|
||||
return new ToStringFromIntEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromIntEvaluator(source, integer.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromIntEvaluator[field=" + field + "]";
|
||||
return "ToStringFromIntEvaluator[" + "integer=" + integer + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator lng;
|
||||
|
||||
public ToStringFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator lng,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromLongEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongVector container, int index) {
|
||||
private BytesRef evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromLongEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongBlock container, int index) {
|
||||
private BytesRef evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(lng);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory lng;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory lng) {
|
||||
this.source = source;
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromLongEvaluator get(DriverContext context) {
|
||||
return new ToStringFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromLongEvaluator(source, lng.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromLongEvaluator[field=" + field + "]";
|
||||
return "ToStringFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromUnsignedLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator lng;
|
||||
|
||||
public ToStringFromUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator lng,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromUnsignedLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromUnsignedLongEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongVector container, int index) {
|
||||
private BytesRef evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromUnsignedLong(value);
|
||||
}
|
||||
|
@ -81,29 +85,39 @@ public final class ToStringFromUnsignedLongEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(LongBlock container, int index) {
|
||||
private BytesRef evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToString.fromUnsignedLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromUnsignedLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(lng);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory lng;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory lng) {
|
||||
this.source = source;
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromUnsignedLongEvaluator get(DriverContext context) {
|
||||
return new ToStringFromUnsignedLongEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromUnsignedLongEvaluator(source, lng.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromUnsignedLongEvaluator[field=" + field + "]";
|
||||
return "ToStringFromUnsignedLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToStringFromVersionEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromVersionEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator version;
|
||||
|
||||
public ToStringFromVersionEvaluator(Source source, EvalOperator.ExpressionEvaluator version,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToStringFromVersion";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToStringFromVersionEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromVersion(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToStringFromVersionEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToString.fromVersion(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromVersionEvaluator[" + "version=" + version + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(version);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory version;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory version) {
|
||||
this.source = source;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToStringFromVersionEvaluator get(DriverContext context) {
|
||||
return new ToStringFromVersionEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromVersionEvaluator(source, version.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromVersionEvaluator[field=" + field + "]";
|
||||
return "ToStringFromVersionEvaluator[" + "version=" + version + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToUnsignedLongFromBooleanEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToUnsignedLongFromBooleanEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator bool;
|
||||
|
||||
public ToUnsignedLongFromBooleanEvaluator(Source source, EvalOperator.ExpressionEvaluator bool,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToUnsignedLongFromBoolean";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +49,7 @@ public final class ToUnsignedLongFromBooleanEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BooleanVector container, int index) {
|
||||
private long evalValue(BooleanVector container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToUnsignedLong.fromBoolean(value);
|
||||
}
|
||||
|
@ -80,29 +84,39 @@ public final class ToUnsignedLongFromBooleanEvaluator extends AbstractConvertFun
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BooleanBlock container, int index) {
|
||||
private long evalValue(BooleanBlock container, int index) {
|
||||
boolean value = container.getBoolean(index);
|
||||
return ToUnsignedLong.fromBoolean(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(bool);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory bool;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory bool) {
|
||||
this.source = source;
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToUnsignedLongFromBooleanEvaluator get(DriverContext context) {
|
||||
return new ToUnsignedLongFromBooleanEvaluator(field.get(context), source, context);
|
||||
return new ToUnsignedLongFromBooleanEvaluator(source, bool.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromBooleanEvaluator[field=" + field + "]";
|
||||
return "ToUnsignedLongFromBooleanEvaluator[" + "bool=" + bool + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToUnsignedLongFromDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToUnsignedLongFromDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator dbl;
|
||||
|
||||
public ToUnsignedLongFromDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator dbl,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToUnsignedLongFromDouble";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToUnsignedLongFromDoubleEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleVector container, int index) {
|
||||
private long evalValue(DoubleVector container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToUnsignedLong.fromDouble(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToUnsignedLongFromDoubleEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(DoubleBlock container, int index) {
|
||||
private long evalValue(DoubleBlock container, int index) {
|
||||
double value = container.getDouble(index);
|
||||
return ToUnsignedLong.fromDouble(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(dbl);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory dbl;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory dbl) {
|
||||
this.source = source;
|
||||
this.dbl = dbl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToUnsignedLongFromDoubleEvaluator get(DriverContext context) {
|
||||
return new ToUnsignedLongFromDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToUnsignedLongFromDoubleEvaluator(source, dbl.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromDoubleEvaluator[field=" + field + "]";
|
||||
return "ToUnsignedLongFromDoubleEvaluator[" + "dbl=" + dbl + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -21,14 +22,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToUnsignedLongFromIntEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToUnsignedLongFromIntEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator i;
|
||||
|
||||
public ToUnsignedLongFromIntEvaluator(Source source, EvalOperator.ExpressionEvaluator i,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToUnsignedLongFromInt";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,7 +60,7 @@ public final class ToUnsignedLongFromIntEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(IntVector container, int index) {
|
||||
private long evalValue(IntVector container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToUnsignedLong.fromInt(value);
|
||||
}
|
||||
|
@ -95,29 +99,39 @@ public final class ToUnsignedLongFromIntEvaluator extends AbstractConvertFunctio
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(IntBlock container, int index) {
|
||||
private long evalValue(IntBlock container, int index) {
|
||||
int value = container.getInt(index);
|
||||
return ToUnsignedLong.fromInt(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(i);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory i;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory i) {
|
||||
this.source = source;
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToUnsignedLongFromIntEvaluator get(DriverContext context) {
|
||||
return new ToUnsignedLongFromIntEvaluator(field.get(context), source, context);
|
||||
return new ToUnsignedLongFromIntEvaluator(source, i.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromIntEvaluator[field=" + field + "]";
|
||||
return "ToUnsignedLongFromIntEvaluator[" + "i=" + i + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToUnsignedLongFromLongEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToUnsignedLongFromLongEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator lng;
|
||||
|
||||
public ToUnsignedLongFromLongEvaluator(Source source, EvalOperator.ExpressionEvaluator lng,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToUnsignedLongFromLong";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +59,7 @@ public final class ToUnsignedLongFromLongEvaluator extends AbstractConvertFuncti
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongVector container, int index) {
|
||||
private long evalValue(LongVector container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToUnsignedLong.fromLong(value);
|
||||
}
|
||||
|
@ -94,29 +98,39 @@ public final class ToUnsignedLongFromLongEvaluator extends AbstractConvertFuncti
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(LongBlock container, int index) {
|
||||
private long evalValue(LongBlock container, int index) {
|
||||
long value = container.getLong(index);
|
||||
return ToUnsignedLong.fromLong(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(lng);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory lng;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory lng) {
|
||||
this.source = source;
|
||||
this.lng = lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToUnsignedLongFromLongEvaluator get(DriverContext context) {
|
||||
return new ToUnsignedLongFromLongEvaluator(field.get(context), source, context);
|
||||
return new ToUnsignedLongFromLongEvaluator(source, lng.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromLongEvaluator[field=" + field + "]";
|
||||
return "ToUnsignedLongFromLongEvaluator[" + "lng=" + lng + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.LongBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.InvalidArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToUnsignedLongFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToUnsignedLongFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public ToUnsignedLongFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToUnsignedLongFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class ToUnsignedLongFromStringEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToUnsignedLong.fromKeyword(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class ToUnsignedLongFromStringEvaluator extends AbstractConvertFunc
|
|||
}
|
||||
}
|
||||
|
||||
private static long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private long evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToUnsignedLong.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToUnsignedLongFromStringEvaluator get(DriverContext context) {
|
||||
return new ToUnsignedLongFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToUnsignedLongFromStringEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToUnsignedLongFromStringEvaluator[field=" + field + "]";
|
||||
return "ToUnsignedLongFromStringEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +21,17 @@ import org.elasticsearch.xpack.esql.core.tree.Source;
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ToVersionFromStringEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToVersionFromStringEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator asString;
|
||||
|
||||
public ToVersionFromStringEvaluator(Source source, EvalOperator.ExpressionEvaluator asString,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.asString = asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ToVersionFromString";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,7 +50,7 @@ public final class ToVersionFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToVersion.fromKeyword(value);
|
||||
}
|
||||
|
@ -82,29 +86,39 @@ public final class ToVersionFromStringEvaluator extends AbstractConvertFunction.
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ToVersion.fromKeyword(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToVersionFromStringEvaluator[" + "asString=" + asString + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(asString);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory asString;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory asString) {
|
||||
this.source = source;
|
||||
this.asString = asString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToVersionFromStringEvaluator get(DriverContext context) {
|
||||
return new ToVersionFromStringEvaluator(field.get(context), source, context);
|
||||
return new ToVersionFromStringEvaluator(source, asString.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToVersionFromStringEvaluator[field=" + field + "]";
|
||||
return "ToVersionFromStringEvaluator[" + "asString=" + asString + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StEnvelopeFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StEnvelopeFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StEnvelopeFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StEnvelopeFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class StEnvelopeFromWKBEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StEnvelope.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class StEnvelopeFromWKBEvaluator extends AbstractConvertFunction.Ab
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StEnvelope.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StEnvelopeFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StEnvelopeFromWKBEvaluator get(DriverContext context) {
|
||||
return new StEnvelopeFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StEnvelopeFromWKBEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StEnvelopeFromWKBEvaluator[field=" + field + "]";
|
||||
return "StEnvelopeFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -22,14 +23,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StEnvelopeFromWKBGeoEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StEnvelopeFromWKBGeoEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StEnvelopeFromWKBGeoEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StEnvelopeFromWKBGeo";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +62,7 @@ public final class StEnvelopeFromWKBGeoEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StEnvelope.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
@ -98,29 +102,39 @@ public final class StEnvelopeFromWKBGeoEvaluator extends AbstractConvertFunction
|
|||
}
|
||||
}
|
||||
|
||||
private static BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StEnvelope.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StEnvelopeFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StEnvelopeFromWKBGeoEvaluator get(DriverContext context) {
|
||||
return new StEnvelopeFromWKBGeoEvaluator(field.get(context), source, context);
|
||||
return new StEnvelopeFromWKBGeoEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StEnvelopeFromWKBGeoEvaluator[field=" + field + "]";
|
||||
return "StEnvelopeFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StXFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StXFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public StXFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StXFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StXFromWKBEvaluator extends AbstractConvertFunction.AbstractE
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StX.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StXFromWKBEvaluator extends AbstractConvertFunction.AbstractE
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StX.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXFromWKBEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StXFromWKBEvaluator get(DriverContext context) {
|
||||
return new StXFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StXFromWKBEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXFromWKBEvaluator[field=" + field + "]";
|
||||
return "StXFromWKBEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StXMaxFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StXMaxFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StXMaxFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StXMaxFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StXMaxFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMax.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StXMaxFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMax.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMaxFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StXMaxFromWKBEvaluator get(DriverContext context) {
|
||||
return new StXMaxFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StXMaxFromWKBEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMaxFromWKBEvaluator[field=" + field + "]";
|
||||
return "StXMaxFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StXMaxFromWKBGeoEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StXMaxFromWKBGeoEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StXMaxFromWKBGeoEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StXMaxFromWKBGeo";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StXMaxFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMax.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StXMaxFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMax.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMaxFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StXMaxFromWKBGeoEvaluator get(DriverContext context) {
|
||||
return new StXMaxFromWKBGeoEvaluator(field.get(context), source, context);
|
||||
return new StXMaxFromWKBGeoEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMaxFromWKBGeoEvaluator[field=" + field + "]";
|
||||
return "StXMaxFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StXMinFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StXMinFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StXMinFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StXMinFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StXMinFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMin.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StXMinFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMin.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMinFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StXMinFromWKBEvaluator get(DriverContext context) {
|
||||
return new StXMinFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StXMinFromWKBEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMinFromWKBEvaluator[field=" + field + "]";
|
||||
return "StXMinFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StXMinFromWKBGeoEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StXMinFromWKBGeoEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StXMinFromWKBGeoEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StXMinFromWKBGeo";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StXMinFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMin.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StXMinFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StXMin.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMinFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StXMinFromWKBGeoEvaluator get(DriverContext context) {
|
||||
return new StXMinFromWKBGeoEvaluator(field.get(context), source, context);
|
||||
return new StXMinFromWKBGeoEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StXMinFromWKBGeoEvaluator[field=" + field + "]";
|
||||
return "StXMinFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StYFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StYFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator in;
|
||||
|
||||
public StYFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator in,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StYFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StYFromWKBEvaluator extends AbstractConvertFunction.AbstractE
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StY.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StYFromWKBEvaluator extends AbstractConvertFunction.AbstractE
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StY.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYFromWKBEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(in);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory in;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory in) {
|
||||
this.source = source;
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StYFromWKBEvaluator get(DriverContext context) {
|
||||
return new StYFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StYFromWKBEvaluator(source, in.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYFromWKBEvaluator[field=" + field + "]";
|
||||
return "StYFromWKBEvaluator[" + "in=" + in + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StYMaxFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StYMaxFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StYMaxFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StYMaxFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StYMaxFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMax.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StYMaxFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMax.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMaxFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StYMaxFromWKBEvaluator get(DriverContext context) {
|
||||
return new StYMaxFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StYMaxFromWKBEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMaxFromWKBEvaluator[field=" + field + "]";
|
||||
return "StYMaxFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StYMaxFromWKBGeoEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StYMaxFromWKBGeoEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StYMaxFromWKBGeoEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StYMaxFromWKBGeo";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StYMaxFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMax.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StYMaxFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMax.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMaxFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StYMaxFromWKBGeoEvaluator get(DriverContext context) {
|
||||
return new StYMaxFromWKBGeoEvaluator(field.get(context), source, context);
|
||||
return new StYMaxFromWKBGeoEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMaxFromWKBGeoEvaluator[field=" + field + "]";
|
||||
return "StYMaxFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StYMinFromWKBEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StYMinFromWKBEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StYMinFromWKBEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StYMinFromWKB";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StYMinFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMin.fromWellKnownBinary(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StYMinFromWKBEvaluator extends AbstractConvertFunction.Abstra
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMin.fromWellKnownBinary(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMinFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StYMinFromWKBEvaluator get(DriverContext context) {
|
||||
return new StYMinFromWKBEvaluator(field.get(context), source, context);
|
||||
return new StYMinFromWKBEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMinFromWKBEvaluator[field=" + field + "]";
|
||||
return "StYMinFromWKBEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.DoubleBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
|
@ -23,14 +24,17 @@ import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractC
|
|||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class StYMinFromWKBGeoEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public StYMinFromWKBGeoEvaluator(EvalOperator.ExpressionEvaluator field, Source source,
|
||||
private final EvalOperator.ExpressionEvaluator wkb;
|
||||
|
||||
public StYMinFromWKBGeoEvaluator(Source source, EvalOperator.ExpressionEvaluator wkb,
|
||||
DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
super(driverContext, source);
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "StYMinFromWKBGeo";
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +63,7 @@ public final class StYMinFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMin.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
@ -99,29 +103,39 @@ public final class StYMinFromWKBGeoEvaluator extends AbstractConvertFunction.Abs
|
|||
}
|
||||
}
|
||||
|
||||
private static double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
private double evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return StYMin.fromWellKnownBinaryGeo(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMinFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(wkb);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory wkb;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory wkb) {
|
||||
this.source = source;
|
||||
this.wkb = wkb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StYMinFromWKBGeoEvaluator get(DriverContext context) {
|
||||
return new StYMinFromWKBGeoEvaluator(field.get(context), source, context);
|
||||
return new StYMinFromWKBGeoEvaluator(source, wkb.get(context), context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StYMinFromWKBGeoEvaluator[field=" + field + "]";
|
||||
return "StYMinFromWKBGeoEvaluator[" + "wkb=" + wkb + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// 2.0.
|
||||
package org.elasticsearch.xpack.esql.expression.function.scalar.string;
|
||||
|
||||
import java.lang.IllegalArgumentException;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Locale;
|
||||
|
@ -12,79 +11,92 @@ import org.apache.lucene.util.BytesRef;
|
|||
import org.elasticsearch.compute.data.Block;
|
||||
import org.elasticsearch.compute.data.BytesRefBlock;
|
||||
import org.elasticsearch.compute.data.BytesRefVector;
|
||||
import org.elasticsearch.compute.data.Page;
|
||||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.compute.operator.Warnings;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
|
||||
|
||||
/**
|
||||
* {@link EvalOperator.ExpressionEvaluator} implementation for {@link ChangeCase}.
|
||||
* This class is generated. Edit {@code EvaluatorImplementer} instead.
|
||||
* This class is generated. Edit {@code ConvertEvaluatorImplementer} instead.
|
||||
*/
|
||||
public final class ChangeCaseEvaluator implements EvalOperator.ExpressionEvaluator {
|
||||
private final Source source;
|
||||
|
||||
public final class ChangeCaseEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
private final EvalOperator.ExpressionEvaluator val;
|
||||
|
||||
private final Locale locale;
|
||||
|
||||
private final ChangeCase.Case caseType;
|
||||
|
||||
private final DriverContext driverContext;
|
||||
|
||||
private Warnings warnings;
|
||||
|
||||
public ChangeCaseEvaluator(Source source, EvalOperator.ExpressionEvaluator val, Locale locale,
|
||||
ChangeCase.Case caseType, DriverContext driverContext) {
|
||||
this.source = source;
|
||||
super(driverContext, source);
|
||||
this.val = val;
|
||||
this.locale = locale;
|
||||
this.caseType = caseType;
|
||||
this.driverContext = driverContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block eval(Page page) {
|
||||
try (BytesRefBlock valBlock = (BytesRefBlock) val.eval(page)) {
|
||||
BytesRefVector valVector = valBlock.asVector();
|
||||
if (valVector == null) {
|
||||
return eval(page.getPositionCount(), valBlock);
|
||||
public EvalOperator.ExpressionEvaluator next() {
|
||||
return val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block evalVector(Vector v) {
|
||||
BytesRefVector vector = (BytesRefVector) v;
|
||||
int positionCount = v.getPositionCount();
|
||||
BytesRef scratchPad = new BytesRef();
|
||||
if (vector.isConstant()) {
|
||||
return driverContext.blockFactory().newConstantBytesRefBlockWith(evalValue(vector, 0, scratchPad), positionCount);
|
||||
}
|
||||
try (BytesRefBlock.Builder builder = driverContext.blockFactory().newBytesRefBlockBuilder(positionCount)) {
|
||||
for (int p = 0; p < positionCount; p++) {
|
||||
builder.appendBytesRef(evalValue(vector, p, scratchPad));
|
||||
}
|
||||
return eval(page.getPositionCount(), valVector).asBlock();
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
public BytesRefBlock eval(int positionCount, BytesRefBlock valBlock) {
|
||||
try(BytesRefBlock.Builder result = driverContext.blockFactory().newBytesRefBlockBuilder(positionCount)) {
|
||||
BytesRef valScratch = new BytesRef();
|
||||
position: for (int p = 0; p < positionCount; p++) {
|
||||
if (valBlock.isNull(p)) {
|
||||
result.appendNull();
|
||||
continue position;
|
||||
}
|
||||
if (valBlock.getValueCount(p) != 1) {
|
||||
if (valBlock.getValueCount(p) > 1) {
|
||||
warnings().registerException(new IllegalArgumentException("single-value function encountered multi-value"));
|
||||
private BytesRef evalValue(BytesRefVector container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ChangeCase.process(value, this.locale, this.caseType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block evalBlock(Block b) {
|
||||
BytesRefBlock block = (BytesRefBlock) b;
|
||||
int positionCount = block.getPositionCount();
|
||||
try (BytesRefBlock.Builder builder = driverContext.blockFactory().newBytesRefBlockBuilder(positionCount)) {
|
||||
BytesRef scratchPad = new BytesRef();
|
||||
for (int p = 0; p < positionCount; p++) {
|
||||
int valueCount = block.getValueCount(p);
|
||||
int start = block.getFirstValueIndex(p);
|
||||
int end = start + valueCount;
|
||||
boolean positionOpened = false;
|
||||
boolean valuesAppended = false;
|
||||
for (int i = start; i < end; i++) {
|
||||
BytesRef value = evalValue(block, i, scratchPad);
|
||||
if (positionOpened == false && valueCount > 1) {
|
||||
builder.beginPositionEntry();
|
||||
positionOpened = true;
|
||||
}
|
||||
result.appendNull();
|
||||
continue position;
|
||||
builder.appendBytesRef(value);
|
||||
valuesAppended = true;
|
||||
}
|
||||
if (valuesAppended == false) {
|
||||
builder.appendNull();
|
||||
} else if (positionOpened) {
|
||||
builder.endPositionEntry();
|
||||
}
|
||||
result.appendBytesRef(ChangeCase.process(valBlock.getBytesRef(valBlock.getFirstValueIndex(p), valScratch), this.locale, this.caseType));
|
||||
}
|
||||
return result.build();
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
public BytesRefVector eval(int positionCount, BytesRefVector valVector) {
|
||||
try(BytesRefVector.Builder result = driverContext.blockFactory().newBytesRefVectorBuilder(positionCount)) {
|
||||
BytesRef valScratch = new BytesRef();
|
||||
position: for (int p = 0; p < positionCount; p++) {
|
||||
result.appendBytesRef(ChangeCase.process(valVector.getBytesRef(p, valScratch), this.locale, this.caseType));
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
private BytesRef evalValue(BytesRefBlock container, int index, BytesRef scratchPad) {
|
||||
BytesRef value = container.getBytesRef(index, scratchPad);
|
||||
return ChangeCase.process(value, this.locale, this.caseType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,19 +109,7 @@ public final class ChangeCaseEvaluator implements EvalOperator.ExpressionEvaluat
|
|||
Releasables.closeExpectNoException(val);
|
||||
}
|
||||
|
||||
private Warnings warnings() {
|
||||
if (warnings == null) {
|
||||
this.warnings = Warnings.createWarnings(
|
||||
driverContext.warningsMode(),
|
||||
source.source().getLineNumber(),
|
||||
source.source().getColumnNumber(),
|
||||
source.text()
|
||||
);
|
||||
}
|
||||
return warnings;
|
||||
}
|
||||
|
||||
static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
|
||||
private final EvalOperator.ExpressionEvaluator.Factory val;
|
||||
|
|
|
@ -875,7 +875,12 @@ public class EsqlCapabilities {
|
|||
/**
|
||||
* Full text functions can be scored when being part of a disjunction
|
||||
*/
|
||||
FULL_TEXT_FUNCTIONS_DISJUNCTIONS_SCORE;
|
||||
FULL_TEXT_FUNCTIONS_DISJUNCTIONS_SCORE,
|
||||
|
||||
/**
|
||||
* Do {@code TO_LOWER} and {@code TO_UPPER} process all field values?
|
||||
*/
|
||||
TO_LOWER_MV;
|
||||
|
||||
private final boolean enabled;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.compute.operator.DriverContext;
|
|||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator;
|
||||
import org.elasticsearch.compute.operator.Warnings;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
|
||||
import org.elasticsearch.xpack.esql.core.expression.Expression;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
@ -66,7 +65,7 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
if (factory == null) {
|
||||
throw EsqlIllegalArgumentException.illegalDataType(sourceType);
|
||||
}
|
||||
return factory.build(fieldEval, source());
|
||||
return factory.build(source(), fieldEval);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,7 +100,7 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
|
||||
@FunctionalInterface
|
||||
interface BuildFactory {
|
||||
ExpressionEvaluator.Factory build(ExpressionEvaluator.Factory field, Source source);
|
||||
ExpressionEvaluator.Factory build(Source source, ExpressionEvaluator.Factory field);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,12 +130,10 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
private static final Log logger = LogFactory.getLog(AbstractEvaluator.class);
|
||||
|
||||
protected final DriverContext driverContext;
|
||||
private final EvalOperator.ExpressionEvaluator fieldEvaluator;
|
||||
private final Warnings warnings;
|
||||
|
||||
protected AbstractEvaluator(DriverContext driverContext, EvalOperator.ExpressionEvaluator field, Source source) {
|
||||
protected AbstractEvaluator(DriverContext driverContext, Source source) {
|
||||
this.driverContext = driverContext;
|
||||
this.fieldEvaluator = field;
|
||||
this.warnings = Warnings.createWarnings(
|
||||
driverContext.warningsMode(),
|
||||
source.source().getLineNumber(),
|
||||
|
@ -145,7 +142,7 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
);
|
||||
}
|
||||
|
||||
protected abstract String name();
|
||||
protected abstract ExpressionEvaluator next();
|
||||
|
||||
/**
|
||||
* Called when evaluating a {@link Block} that contains null values.
|
||||
|
@ -161,7 +158,7 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
|
||||
@Override
|
||||
public final Block eval(Page page) {
|
||||
try (Block block = fieldEvaluator.eval(page)) {
|
||||
try (Block block = next().eval(page)) {
|
||||
Vector vector = block.asVector();
|
||||
return vector == null ? evalBlock(block) : evalVector(vector);
|
||||
}
|
||||
|
@ -171,16 +168,5 @@ public abstract class AbstractConvertFunction extends UnaryScalarFunction {
|
|||
logger.trace("conversion failure", exception);
|
||||
warnings.registerException(exception);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return name() + "Evaluator[field=" + fieldEvaluator + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
// TODO toString allocates - we should probably check breakers there too
|
||||
Releasables.closeExpectNoException(fieldEvaluator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ToBoolean extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(BOOLEAN, (field, source) -> field),
|
||||
Map.entry(BOOLEAN, (source, field) -> field),
|
||||
Map.entry(KEYWORD, ToBooleanFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToBooleanFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToBooleanFromStringEvaluator.Factory::new),
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ToCartesianPoint extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(CARTESIAN_POINT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(CARTESIAN_POINT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(KEYWORD, ToCartesianPointFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToCartesianPointFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToCartesianPointFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -38,8 +38,8 @@ public class ToCartesianShape extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(CARTESIAN_POINT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(CARTESIAN_SHAPE, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(CARTESIAN_POINT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(CARTESIAN_SHAPE, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(KEYWORD, ToCartesianShapeFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToCartesianShapeFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToCartesianShapeFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ToDateNanos extends AbstractConvertFunction {
|
|||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(DATETIME, ToDateNanosFromDatetimeEvaluator.Factory::new),
|
||||
Map.entry(DATE_NANOS, (field, source) -> field),
|
||||
Map.entry(DATE_NANOS, (source, field) -> field),
|
||||
Map.entry(LONG, ToDateNanosFromLongEvaluator.Factory::new),
|
||||
Map.entry(KEYWORD, ToDateNanosFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToDateNanosFromStringEvaluator.Factory::new),
|
||||
|
|
|
@ -43,9 +43,9 @@ public class ToDatetime extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(DATETIME, (field, source) -> field),
|
||||
Map.entry(DATETIME, (source, field) -> field),
|
||||
Map.entry(DATE_NANOS, ToDatetimeFromDateNanosEvaluator.Factory::new),
|
||||
Map.entry(LONG, (field, source) -> field),
|
||||
Map.entry(LONG, (source, field) -> field),
|
||||
Map.entry(KEYWORD, ToDatetimeFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToDatetimeFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToDatetimeFromStringEvaluator.Factory::new),
|
||||
|
|
|
@ -42,11 +42,11 @@ public class ToDegrees extends AbstractConvertFunction implements EvaluatorMappe
|
|||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(DOUBLE, ToDegreesEvaluator.Factory::new),
|
||||
Map.entry(INTEGER, (field, source) -> new ToDegreesEvaluator.Factory(new ToDoubleFromIntEvaluator.Factory(field, source), source)),
|
||||
Map.entry(LONG, (field, source) -> new ToDegreesEvaluator.Factory(new ToDoubleFromLongEvaluator.Factory(field, source), source)),
|
||||
Map.entry(INTEGER, (source, field) -> new ToDegreesEvaluator.Factory(source, new ToDoubleFromIntEvaluator.Factory(source, field))),
|
||||
Map.entry(LONG, (source, field) -> new ToDegreesEvaluator.Factory(source, new ToDoubleFromLongEvaluator.Factory(source, field))),
|
||||
Map.entry(
|
||||
UNSIGNED_LONG,
|
||||
(field, source) -> new ToDegreesEvaluator.Factory(new ToDoubleFromUnsignedLongEvaluator.Factory(field, source), source)
|
||||
(source, field) -> new ToDegreesEvaluator.Factory(source, new ToDoubleFromUnsignedLongEvaluator.Factory(source, field))
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ToDouble extends AbstractConvertFunction {
|
|||
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "ToDouble", ToDouble::new);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(DOUBLE, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(DOUBLE, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(BOOLEAN, ToDoubleFromBooleanEvaluator.Factory::new),
|
||||
Map.entry(DATETIME, ToDoubleFromLongEvaluator.Factory::new), // CastLongToDoubleEvaluator would be a candidate, but not MV'd
|
||||
Map.entry(KEYWORD, ToDoubleFromStringEvaluator.Factory::new),
|
||||
|
@ -49,7 +49,7 @@ public class ToDouble extends AbstractConvertFunction {
|
|||
Map.entry(UNSIGNED_LONG, ToDoubleFromUnsignedLongEvaluator.Factory::new),
|
||||
Map.entry(LONG, ToDoubleFromLongEvaluator.Factory::new), // CastLongToDoubleEvaluator would be a candidate, but not MV'd
|
||||
Map.entry(INTEGER, ToDoubleFromIntEvaluator.Factory::new), // CastIntToDoubleEvaluator would be a candidate, but not MV'd
|
||||
Map.entry(DataType.COUNTER_DOUBLE, (field, source) -> field),
|
||||
Map.entry(DataType.COUNTER_DOUBLE, (source, field) -> field),
|
||||
Map.entry(DataType.COUNTER_INTEGER, ToDoubleFromIntEvaluator.Factory::new),
|
||||
Map.entry(DataType.COUNTER_LONG, ToDoubleFromLongEvaluator.Factory::new)
|
||||
);
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ToGeoPoint extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(GEO_POINT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(GEO_POINT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(KEYWORD, ToGeoPointFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToGeoPointFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToGeoPointFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -38,8 +38,8 @@ public class ToGeoShape extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(GEO_POINT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(GEO_SHAPE, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(GEO_POINT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(GEO_SHAPE, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(KEYWORD, ToGeoShapeFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToGeoShapeFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToGeoShapeFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ToIP extends AbstractConvertFunction {
|
|||
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "ToIP", ToIP::new);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(IP, (field, source) -> field),
|
||||
Map.entry(IP, (source, field) -> field),
|
||||
Map.entry(KEYWORD, ToIPFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToIPFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToIPFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ToInteger extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(INTEGER, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(INTEGER, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(BOOLEAN, ToIntegerFromBooleanEvaluator.Factory::new),
|
||||
Map.entry(DATETIME, ToIntegerFromLongEvaluator.Factory::new),
|
||||
Map.entry(KEYWORD, ToIntegerFromStringEvaluator.Factory::new),
|
||||
|
@ -55,7 +55,7 @@ public class ToInteger extends AbstractConvertFunction {
|
|||
Map.entry(DOUBLE, ToIntegerFromDoubleEvaluator.Factory::new),
|
||||
Map.entry(UNSIGNED_LONG, ToIntegerFromUnsignedLongEvaluator.Factory::new),
|
||||
Map.entry(LONG, ToIntegerFromLongEvaluator.Factory::new),
|
||||
Map.entry(COUNTER_INTEGER, (fieldEval, source) -> fieldEval)
|
||||
Map.entry(COUNTER_INTEGER, (source, fieldEval) -> fieldEval)
|
||||
);
|
||||
|
||||
@FunctionInfo(
|
||||
|
|
|
@ -42,9 +42,9 @@ public class ToLong extends AbstractConvertFunction {
|
|||
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "ToLong", ToLong::new);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(LONG, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(DATETIME, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(DATE_NANOS, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(LONG, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(DATETIME, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(DATE_NANOS, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(BOOLEAN, ToLongFromBooleanEvaluator.Factory::new),
|
||||
Map.entry(KEYWORD, ToLongFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToLongFromStringEvaluator.Factory::new),
|
||||
|
@ -52,7 +52,7 @@ public class ToLong extends AbstractConvertFunction {
|
|||
Map.entry(DOUBLE, ToLongFromDoubleEvaluator.Factory::new),
|
||||
Map.entry(UNSIGNED_LONG, ToLongFromUnsignedLongEvaluator.Factory::new),
|
||||
Map.entry(INTEGER, ToLongFromIntEvaluator.Factory::new), // CastIntToLongEvaluator would be a candidate, but not MV'd
|
||||
Map.entry(DataType.COUNTER_LONG, (field, source) -> field),
|
||||
Map.entry(DataType.COUNTER_LONG, (source, field) -> field),
|
||||
Map.entry(DataType.COUNTER_INTEGER, ToLongFromIntEvaluator.Factory::new)
|
||||
);
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ public class ToRadians extends AbstractConvertFunction implements EvaluatorMappe
|
|||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(DOUBLE, ToRadiansEvaluator.Factory::new),
|
||||
Map.entry(INTEGER, (field, source) -> new ToRadiansEvaluator.Factory(new ToDoubleFromIntEvaluator.Factory(field, source), source)),
|
||||
Map.entry(LONG, (field, source) -> new ToRadiansEvaluator.Factory(new ToDoubleFromLongEvaluator.Factory(field, source), source)),
|
||||
Map.entry(INTEGER, (source, field) -> new ToRadiansEvaluator.Factory(source, new ToDoubleFromIntEvaluator.Factory(source, field))),
|
||||
Map.entry(LONG, (source, field) -> new ToRadiansEvaluator.Factory(source, new ToDoubleFromLongEvaluator.Factory(source, field))),
|
||||
Map.entry(
|
||||
UNSIGNED_LONG,
|
||||
(field, source) -> new ToRadiansEvaluator.Factory(new ToDoubleFromUnsignedLongEvaluator.Factory(field, source), source)
|
||||
(source, field) -> new ToRadiansEvaluator.Factory(source, new ToDoubleFromUnsignedLongEvaluator.Factory(source, field))
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ToString extends AbstractConvertFunction implements EvaluatorMapper
|
|||
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "ToString", ToString::new);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(KEYWORD, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(KEYWORD, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(BOOLEAN, ToStringFromBooleanEvaluator.Factory::new),
|
||||
Map.entry(DATETIME, ToStringFromDatetimeEvaluator.Factory::new),
|
||||
Map.entry(DATE_NANOS, ToStringFromDateNanosEvaluator.Factory::new),
|
||||
|
@ -61,8 +61,8 @@ public class ToString extends AbstractConvertFunction implements EvaluatorMapper
|
|||
Map.entry(DOUBLE, ToStringFromDoubleEvaluator.Factory::new),
|
||||
Map.entry(LONG, ToStringFromLongEvaluator.Factory::new),
|
||||
Map.entry(INTEGER, ToStringFromIntEvaluator.Factory::new),
|
||||
Map.entry(TEXT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(SEMANTIC_TEXT, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(TEXT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(SEMANTIC_TEXT, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(VERSION, ToStringFromVersionEvaluator.Factory::new),
|
||||
Map.entry(UNSIGNED_LONG, ToStringFromUnsignedLongEvaluator.Factory::new),
|
||||
Map.entry(GEO_POINT, ToStringFromGeoPointEvaluator.Factory::new),
|
||||
|
|
|
@ -14,18 +14,22 @@ import org.elasticsearch.compute.data.CompositeBlock;
|
|||
import org.elasticsearch.compute.data.Vector;
|
||||
import org.elasticsearch.compute.operator.DriverContext;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.core.Releasables;
|
||||
import org.elasticsearch.xpack.esql.core.tree.Source;
|
||||
|
||||
import static org.elasticsearch.xpack.esql.type.EsqlDataTypeConverter.aggregateMetricDoubleBlockToString;
|
||||
|
||||
public class ToStringFromAggregateMetricDoubleEvaluator extends AbstractConvertFunction.AbstractEvaluator {
|
||||
public ToStringFromAggregateMetricDoubleEvaluator(EvalOperator.ExpressionEvaluator field, Source source, DriverContext driverContext) {
|
||||
super(driverContext, field, source);
|
||||
private final EvalOperator.ExpressionEvaluator field;
|
||||
|
||||
public ToStringFromAggregateMetricDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator field, DriverContext driverContext) {
|
||||
super(driverContext, source);
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String name() {
|
||||
return "ToStringFromAggregateMetricDouble";
|
||||
protected EvalOperator.ExpressionEvaluator next() {
|
||||
return field;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,18 +57,28 @@ public class ToStringFromAggregateMetricDoubleEvaluator extends AbstractConvertF
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ToStringFromAggregateMetricDoubleEvaluator[field=" + field + ']';
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Releasables.closeExpectNoException(field);
|
||||
}
|
||||
|
||||
public static class Factory implements EvalOperator.ExpressionEvaluator.Factory {
|
||||
private final Source source;
|
||||
private final EvalOperator.ExpressionEvaluator.Factory field;
|
||||
|
||||
public Factory(EvalOperator.ExpressionEvaluator.Factory field, Source source) {
|
||||
this.field = field;
|
||||
public Factory(Source source, EvalOperator.ExpressionEvaluator.Factory field) {
|
||||
this.source = source;
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvalOperator.ExpressionEvaluator get(DriverContext context) {
|
||||
return new ToStringFromAggregateMetricDoubleEvaluator(field.get(context), source, context);
|
||||
return new ToStringFromAggregateMetricDoubleEvaluator(source, field.get(context), context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ToUnsignedLong extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(UNSIGNED_LONG, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(UNSIGNED_LONG, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(DATETIME, ToUnsignedLongFromLongEvaluator.Factory::new),
|
||||
Map.entry(BOOLEAN, ToUnsignedLongFromBooleanEvaluator.Factory::new),
|
||||
Map.entry(KEYWORD, ToUnsignedLongFromStringEvaluator.Factory::new),
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ToVersion extends AbstractConvertFunction {
|
|||
);
|
||||
|
||||
private static final Map<DataType, BuildFactory> EVALUATORS = Map.ofEntries(
|
||||
Map.entry(VERSION, (fieldEval, source) -> fieldEval),
|
||||
Map.entry(VERSION, (source, fieldEval) -> fieldEval),
|
||||
Map.entry(KEYWORD, ToVersionFromStringEvaluator.Factory::new),
|
||||
Map.entry(TEXT, ToVersionFromStringEvaluator.Factory::new),
|
||||
Map.entry(SEMANTIC_TEXT, ToVersionFromStringEvaluator.Factory::new)
|
||||
|
|
|
@ -91,9 +91,9 @@ public class StEnvelope extends UnaryScalarFunction {
|
|||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
if (field().dataType() == GEO_POINT || field().dataType() == DataType.GEO_SHAPE) {
|
||||
return new StEnvelopeFromWKBGeoEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StEnvelopeFromWKBGeoEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
return new StEnvelopeFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StEnvelopeFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ public class StX extends UnaryScalarFunction {
|
|||
|
||||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
return new StXFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StXFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,9 +76,9 @@ public class StXMax extends UnaryScalarFunction {
|
|||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
if (field().dataType() == GEO_POINT || field().dataType() == DataType.GEO_SHAPE) {
|
||||
return new StXMaxFromWKBGeoEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StXMaxFromWKBGeoEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
return new StXMaxFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StXMaxFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,9 +76,9 @@ public class StXMin extends UnaryScalarFunction {
|
|||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
if (field().dataType() == GEO_POINT || field().dataType() == DataType.GEO_SHAPE) {
|
||||
return new StXMinFromWKBGeoEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StXMinFromWKBGeoEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
return new StXMinFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StXMinFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ public class StY extends UnaryScalarFunction {
|
|||
|
||||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
return new StYFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StYFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,9 +76,9 @@ public class StYMax extends UnaryScalarFunction {
|
|||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
if (field().dataType() == GEO_POINT || field().dataType() == DataType.GEO_SHAPE) {
|
||||
return new StYMaxFromWKBGeoEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StYMaxFromWKBGeoEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
return new StYMaxFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StYMaxFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,9 +76,9 @@ public class StYMin extends UnaryScalarFunction {
|
|||
@Override
|
||||
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
|
||||
if (field().dataType() == GEO_POINT || field().dataType() == DataType.GEO_SHAPE) {
|
||||
return new StYMinFromWKBGeoEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StYMinFromWKBGeoEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
return new StYMinFromWKBEvaluator.Factory(toEvaluator.apply(field()), source());
|
||||
return new StYMinFromWKBEvaluator.Factory(source(), toEvaluator.apply(field()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.string;
|
|||
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.common.lucene.BytesRefs;
|
||||
import org.elasticsearch.compute.ann.Evaluator;
|
||||
import org.elasticsearch.compute.ann.ConvertEvaluator;
|
||||
import org.elasticsearch.compute.ann.Fixed;
|
||||
import org.elasticsearch.compute.operator.EvalOperator;
|
||||
import org.elasticsearch.xpack.esql.core.expression.Expression;
|
||||
|
@ -99,7 +99,7 @@ public abstract class ChangeCase extends EsqlConfigurationFunction {
|
|||
return replaceChild(newChildren.get(0));
|
||||
}
|
||||
|
||||
@Evaluator
|
||||
@ConvertEvaluator
|
||||
static BytesRef process(BytesRef val, @Fixed Locale locale, @Fixed Case caseType) {
|
||||
return BytesRefs.toBytesRef(caseType.process(val.utf8ToString(), locale));
|
||||
}
|
||||
|
|
|
@ -28,17 +28,11 @@ public class ToLower extends ChangeCase {
|
|||
@FunctionInfo(
|
||||
returnType = { "keyword" },
|
||||
description = "Returns a new string representing the input string converted to lower case.",
|
||||
examples = @Example(file = "string", tag = "to_lower")
|
||||
examples = { @Example(file = "string", tag = "to_lower"), @Example(file = "string", tag = "to_lower_mv"), }
|
||||
)
|
||||
public ToLower(
|
||||
Source source,
|
||||
@Param(
|
||||
name = "str",
|
||||
type = { "keyword", "text" },
|
||||
description = "String expression. If `null`, the function returns `null`."
|
||||
) Expression field,
|
||||
Configuration configuration
|
||||
) {
|
||||
public ToLower(Source source, @Param(name = "str", type = { "keyword", "text" }, description = """
|
||||
String expression. If `null`, the function returns `null`.
|
||||
The input can be a single- or multi-valued column or an expression.""") Expression field, Configuration configuration) {
|
||||
super(source, field, configuration, Case.LOWER);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,15 +30,9 @@ public class ToUpper extends ChangeCase {
|
|||
description = "Returns a new string representing the input string converted to upper case.",
|
||||
examples = @Example(file = "string", tag = "to_upper")
|
||||
)
|
||||
public ToUpper(
|
||||
Source source,
|
||||
@Param(
|
||||
name = "str",
|
||||
type = { "keyword", "text" },
|
||||
description = "String expression. If `null`, the function returns `null`."
|
||||
) Expression field,
|
||||
Configuration configuration
|
||||
) {
|
||||
public ToUpper(Source source, @Param(name = "str", type = { "keyword", "text" }, description = """
|
||||
String expression. If `null`, the function returns `null`.
|
||||
The input can be a single- or multi-valued column or an expression.""") Expression field, Configuration configuration) {
|
||||
super(source, field, configuration, Case.UPPER);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ToBooleanTests extends AbstractScalarFunctionTestCase {
|
|||
|
||||
TestCaseSupplier.forUnaryInt(
|
||||
suppliers,
|
||||
"ToBooleanFromIntEvaluator[field=" + read + "]",
|
||||
"ToBooleanFromIntEvaluator[i=" + read + "]",
|
||||
DataType.BOOLEAN,
|
||||
i -> i != 0,
|
||||
Integer.MIN_VALUE,
|
||||
|
@ -47,7 +47,7 @@ public class ToBooleanTests extends AbstractScalarFunctionTestCase {
|
|||
);
|
||||
TestCaseSupplier.forUnaryLong(
|
||||
suppliers,
|
||||
"ToBooleanFromLongEvaluator[field=" + read + "]",
|
||||
"ToBooleanFromLongEvaluator[l=" + read + "]",
|
||||
DataType.BOOLEAN,
|
||||
l -> l != 0,
|
||||
Long.MIN_VALUE,
|
||||
|
@ -56,7 +56,7 @@ public class ToBooleanTests extends AbstractScalarFunctionTestCase {
|
|||
);
|
||||
TestCaseSupplier.forUnaryUnsignedLong(
|
||||
suppliers,
|
||||
"ToBooleanFromUnsignedLongEvaluator[field=" + read + "]",
|
||||
"ToBooleanFromUnsignedLongEvaluator[ul=" + read + "]",
|
||||
DataType.BOOLEAN,
|
||||
ul -> ul.compareTo(BigInteger.ZERO) != 0,
|
||||
BigInteger.ZERO,
|
||||
|
@ -65,7 +65,7 @@ public class ToBooleanTests extends AbstractScalarFunctionTestCase {
|
|||
);
|
||||
TestCaseSupplier.forUnaryDouble(
|
||||
suppliers,
|
||||
"ToBooleanFromDoubleEvaluator[field=" + read + "]",
|
||||
"ToBooleanFromDoubleEvaluator[d=" + read + "]",
|
||||
DataType.BOOLEAN,
|
||||
d -> d != 0d,
|
||||
Double.NEGATIVE_INFINITY,
|
||||
|
@ -74,7 +74,7 @@ public class ToBooleanTests extends AbstractScalarFunctionTestCase {
|
|||
);
|
||||
TestCaseSupplier.forUnaryStrings(
|
||||
suppliers,
|
||||
"ToBooleanFromStringEvaluator[field=" + read + "]",
|
||||
"ToBooleanFromStringEvaluator[keyword=" + read + "]",
|
||||
DataType.BOOLEAN,
|
||||
bytesRef -> String.valueOf(bytesRef).toLowerCase(Locale.ROOT).equals("true"),
|
||||
emptyList()
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue