Skip to content

Commit 18ae4ef

Browse files
committed
fixup
1 parent e78023b commit 18ae4ef

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/Clamp.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
* Clamps the values of all samples to have a lower limit of min and an upper limit of max.
3434
*/
3535
public class Clamp extends EsqlScalarFunction implements SurrogateExpression {
36-
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(Expression.class, "Clamp", Clamp::new);
37-
3836
private final Expression field;
3937
private final Expression min;
4038
private final Expression max;
@@ -68,18 +66,9 @@ public Clamp(
6866
this.max = max;
6967
}
7068

71-
private Clamp(StreamInput in) throws IOException {
72-
this(
73-
Source.readFrom((PlanStreamInput) in),
74-
in.readNamedWriteable(Expression.class),
75-
in.readNamedWriteable(Expression.class),
76-
in.readNamedWriteable(Expression.class)
77-
);
78-
}
79-
8069
@Override
8170
public String getWriteableName() {
82-
return ENTRY.name;
71+
throw new UnsupportedOperationException("Clamp does not support serialization.");
8372
}
8473

8574
@Override
@@ -135,10 +124,7 @@ protected NodeInfo<? extends Expression> info() {
135124

136125
@Override
137126
public void writeTo(StreamOutput out) throws IOException {
138-
source().writeTo(out);
139-
out.writeNamedWriteable(field);
140-
out.writeNamedWriteable(min);
141-
out.writeNamedWriteable(max);
127+
throw new UnsupportedOperationException("Clamp does not support serialization.");
142128
}
143129

144130
@Override

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ScalarFunctionWritables.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
9292
entries.add(MonthName.ENTRY);
9393
entries.add(IpPrefix.ENTRY);
9494
entries.add(Least.ENTRY);
95-
entries.add(Clamp.ENTRY);
9695
entries.add(ClampMax.ENTRY);
9796
entries.add(ClampMin.ENTRY);
9897
entries.add(Left.ENTRY);

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/ClampTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ public ClampTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCase
3131
this.testCase = testCaseSupplier.get();
3232
}
3333

34-
@ParametersFactory
34+
@Override
35+
protected boolean canSerialize() {
36+
return false;
37+
}
38+
39+
@ParametersFactory
3540
public static Iterable<Object[]> parameters() {
3641
List<TestCaseSupplier> suppliers = new java.util.ArrayList<>();
3742
for (DataType stringType : DataType.stringTypes()) {

0 commit comments

Comments
 (0)