From f9b1629a5d07cd87de56d087f5d8d9ec72e18686 Mon Sep 17 00:00:00 2001 From: Mark Tozzi Date: Wed, 31 Jan 2024 10:09:42 -0500 Subject: [PATCH] remove redundant check --- .../operator/arithmetic/EsqlArithmeticOperation.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java index 75aaa97083323..3907d788a2ef1 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java @@ -134,12 +134,7 @@ protected TypeResolution checkCompatibility() { || (leftType == UNSIGNED_LONG && (false == (rightType == UNSIGNED_LONG || rightType == DataTypes.NULL)))) { return new TypeResolution(formatIncompatibleTypesMessage(symbol(), leftType, rightType)); } - // If the LHS is numeric, the RHS should be numeric or null - if (leftType.isNumeric()) { - if (false == (rightType.isNumeric() || DataTypes.isNull(rightType))) { - return new TypeResolution(formatIncompatibleTypesMessage(symbol(), leftType, rightType)); - } - } + // at this point, left should be null, and right should be null or numeric. return TypeResolution.TYPE_RESOLVED; }