You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/CopySign.java
+42-18Lines changed: 42 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -65,12 +65,12 @@ public CopySign(
65
65
Sourcesource,
66
66
@Param(
67
67
name = "magnitude",
68
-
type = { "double", "float" },
68
+
type = { "double", "float", "integer", "long" },
69
69
description = "The expression providing the magnitude of the result. Must be a numeric type."
70
70
) Expressionmagnitude,
71
71
@Param(
72
72
name = "sign",
73
-
type = { "double", "float" },
73
+
type = { "double", "float", "integer", "long" },
74
74
description = "The expression providing the sign of the result. Must be a numeric type."
75
75
) Expressionsign
76
76
) {
@@ -122,24 +122,31 @@ public TypeResolution resolveType() {
122
122
}
123
123
varmagnitude = children().get(0);
124
124
varsign = children().get(1);
125
-
if (magnitude.dataType().isNumeric() == false || magnitude.dataType().isRationalNumber() == false) {
126
-
returnnewTypeResolution("Magnitude must be a float or double type");
125
+
if (magnitude.dataType().isNumeric() == false) {
126
+
returnnewTypeResolution("Magnitude must be a numeric type");
127
127
}
128
-
if (sign.dataType().isNumeric() == false || sign.dataType().isRationalNumber() == false) {
129
-
returnnewTypeResolution("Sign must be a float or double type");
128
+
if (sign.dataType().isNumeric() == false) {
129
+
returnnewTypeResolution("Sign must be a numeric type");
0 commit comments