Skip to content

Commit

Permalink
spotless apply
Browse files Browse the repository at this point in the history
  • Loading branch information
not-napoleon committed Jan 31, 2024
1 parent f9b1629 commit 73cec9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Collection;
import java.util.function.Function;

import static org.elasticsearch.common.logging.LoggerMessageFormat.format;
import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.DATE_PERIOD;
import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.TIME_DURATION;
import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isDateTimeOrTemporal;
Expand Down Expand Up @@ -61,7 +60,8 @@ protected TypeResolution resolveInputType(Expression e, TypeResolutions.ParamOrd
t -> t.isNumeric() || EsqlDataTypes.isDateTimeOrTemporal(t) || DataTypes.isNull(t),
sourceText(),
paramOrdinal,
"datetime", "numeric"
"datetime",
"numeric"
);
}

Expand All @@ -85,9 +85,7 @@ protected TypeResolution checkCompatibility() {
return TypeResolution.TYPE_RESOLVED;
}

return new TypeResolution(
formatIncompatibleTypesMessage(symbol(), leftType, rightType)
);
return new TypeResolution(formatIncompatibleTypesMessage(symbol(), leftType, rightType));
}
return super.checkCompatibility();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,7 @@ protected TypeResolution checkCompatibility() {
}

static String formatIncompatibleTypesMessage(String symbol, DataType leftType, DataType rightType) {
return format(
null,
"[{}] has arguments with incompatible types [{}] and [{}]",
symbol,
leftType.typeName(),
rightType.typeName()
);
return format(null, "[{}] has arguments with incompatible types [{}] and [{}]", symbol, leftType.typeName(), rightType.typeName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import static org.elasticsearch.xpack.esql.EsqlTestUtils.withDefaultLimitWarning;
import static org.elasticsearch.xpack.ql.type.DataTypes.UNSIGNED_LONG;
Expand Down Expand Up @@ -221,15 +220,7 @@ public void testUnsignedLongTypeMixInArithmetics() {
var op = left + " " + operation + " " + right;
assertThat(
error("row n = to_" + type + "(1), ul = to_ul(1) | eval " + op),
containsString(
"["
+ operation
+ "] has arguments with incompatible types ["
+ leftType
+ "] and ["
+ rightType
+ "]"
)
containsString("[" + operation + "] has arguments with incompatible types [" + leftType + "] and [" + rightType + "]")
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.time.Period;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.function.Supplier;

Expand Down Expand Up @@ -259,11 +258,7 @@ private static String addErrorMessageString(boolean includeOrdinal, List<Set<Dat
return typeErrorMessage(includeOrdinal, validPerPosition, types);
} catch (IllegalStateException e) {
// This means all the positional args were okay, so the expected error is from the combination
return "[+] has arguments with incompatible types ["
+ types.get(0).typeName()
+ "] and ["
+ types.get(1).typeName()
+ "]";
return "[+] has arguments with incompatible types [" + types.get(0).typeName() + "] and [" + types.get(1).typeName() + "]";

}
}
Expand Down

0 comments on commit 73cec9d

Please sign in to comment.