|
@@ -21,8 +21,11 @@ import org.elasticsearch.xpack.sql.expression.function.scalar.string.LocateFunct
|
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.ReplaceFunctionProcessor;
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.ReplaceFunctionProcessor;
|
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.StringProcessor.StringOperation;
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.StringProcessor.StringOperation;
|
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.SubstringFunctionProcessor;
|
|
import org.elasticsearch.xpack.sql.expression.function.scalar.string.SubstringFunctionProcessor;
|
|
|
|
|
+import org.elasticsearch.xpack.sql.expression.predicate.IsNotNullProcessor;
|
|
|
import org.elasticsearch.xpack.sql.expression.predicate.logical.BinaryLogicProcessor.BinaryLogicOperation;
|
|
import org.elasticsearch.xpack.sql.expression.predicate.logical.BinaryLogicProcessor.BinaryLogicOperation;
|
|
|
|
|
+import org.elasticsearch.xpack.sql.expression.predicate.logical.NotProcessor;
|
|
|
import org.elasticsearch.xpack.sql.expression.predicate.operator.arithmetic.BinaryArithmeticProcessor.BinaryArithmeticOperation;
|
|
import org.elasticsearch.xpack.sql.expression.predicate.operator.arithmetic.BinaryArithmeticProcessor.BinaryArithmeticOperation;
|
|
|
|
|
+import org.elasticsearch.xpack.sql.expression.predicate.operator.arithmetic.UnaryArithmeticProcessor.UnaryArithmeticOperation;
|
|
|
import org.elasticsearch.xpack.sql.expression.predicate.operator.comparison.BinaryComparisonProcessor.BinaryComparisonOperation;
|
|
import org.elasticsearch.xpack.sql.expression.predicate.operator.comparison.BinaryComparisonProcessor.BinaryComparisonOperation;
|
|
|
import org.elasticsearch.xpack.sql.expression.predicate.regex.RegexProcessor.RegexOperation;
|
|
import org.elasticsearch.xpack.sql.expression.predicate.regex.RegexProcessor.RegexOperation;
|
|
|
import org.elasticsearch.xpack.sql.util.StringUtils;
|
|
import org.elasticsearch.xpack.sql.util.StringUtils;
|
|
@@ -102,6 +105,14 @@ public final class InternalSqlScriptUtils {
|
|
|
return BinaryLogicOperation.OR.apply(left, right);
|
|
return BinaryLogicOperation.OR.apply(left, right);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static Boolean not(Boolean expression) {
|
|
|
|
|
+ return NotProcessor.apply(expression);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static Boolean notNull(Object expression) {
|
|
|
|
|
+ return IsNotNullProcessor.apply(expression);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//
|
|
//
|
|
|
// Regex
|
|
// Regex
|
|
|
//
|
|
//
|
|
@@ -116,20 +127,24 @@ public final class InternalSqlScriptUtils {
|
|
|
return BinaryArithmeticOperation.ADD.apply(left, right);
|
|
return BinaryArithmeticOperation.ADD.apply(left, right);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static Number sub(Number left, Number right) {
|
|
|
|
|
- return BinaryArithmeticOperation.SUB.apply(left, right);
|
|
|
|
|
|
|
+ public static Number div(Number left, Number right) {
|
|
|
|
|
+ return BinaryArithmeticOperation.DIV.apply(left, right);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static Number mod(Number left, Number right) {
|
|
|
|
|
+ return BinaryArithmeticOperation.MOD.apply(left, right);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static Number mul(Number left, Number right) {
|
|
public static Number mul(Number left, Number right) {
|
|
|
return BinaryArithmeticOperation.MUL.apply(left, right);
|
|
return BinaryArithmeticOperation.MUL.apply(left, right);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static Number div(Number left, Number right) {
|
|
|
|
|
- return BinaryArithmeticOperation.DIV.apply(left, right);
|
|
|
|
|
|
|
+ public static Number neg(Number value) {
|
|
|
|
|
+ return UnaryArithmeticOperation.NEGATE.apply(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static Number mod(Number left, Number right) {
|
|
|
|
|
- return BinaryArithmeticOperation.MOD.apply(left, right);
|
|
|
|
|
|
|
+ public static Number sub(Number left, Number right) {
|
|
|
|
|
+ return BinaryArithmeticOperation.SUB.apply(left, right);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static Number round(Number v, Number s) {
|
|
public static Number round(Number v, Number s) {
|