Skip to content

Commit 2d64a58

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent c513e83 commit 2d64a58

File tree

8 files changed

+53
-19
lines changed

8 files changed

+53
-19
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/ChangePointOperator.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public class ChangePointOperator implements Operator {
3636

3737
public static final int INPUT_VALUE_COUNT_LIMIT = 1000;
3838

39-
public record Factory(int metricChannel, int partitionChannel, String sourceText, int sourceLine, int sourceColumn) implements OperatorFactory {
39+
public record Factory(int metricChannel, int partitionChannel, String sourceText, int sourceLine, int sourceColumn)
40+
implements
41+
OperatorFactory {
4042
@Override
4143
public Operator get(DriverContext driverContext) {
4244
return new ChangePointOperator(driverContext, metricChannel, partitionChannel, sourceText, sourceLine, sourceColumn);
@@ -62,7 +64,14 @@ public String describe() {
6264

6365
// TODO: make org.elasticsearch.xpack.esql.core.tree.Source available here
6466
// (by modularizing esql-core) and use that instead of the individual fields.
65-
public ChangePointOperator(DriverContext driverContext, int metricChannel, int partitionChannel, String sourceText, int sourceLine, int sourceColumn) {
67+
public ChangePointOperator(
68+
DriverContext driverContext,
69+
int metricChannel,
70+
int partitionChannel,
71+
String sourceText,
72+
int sourceLine,
73+
int sourceColumn
74+
) {
6675
this.driverContext = driverContext;
6776
this.metricChannel = metricChannel;
6877
this.partitionChannel = partitionChannel;
@@ -229,7 +238,8 @@ private void insertChangePoints(Iterable<ChangeType> changeTypes) {
229238
lastPartitionFieldValue = currentPartitionFieldValue;
230239

231240
try {
232-
if (pageStartIndex <= changeType.changePoint() && changeType.changePoint() < pageStartIndex + inputPage.getPositionCount()) {
241+
if (pageStartIndex <= changeType.changePoint()
242+
&& changeType.changePoint() < pageStartIndex + inputPage.getPositionCount()) {
233243
try (
234244
BytesRefBlock.Builder changeTypeBlockBuilder = blockFactory.newBytesRefBlockBuilder(inputPage.getPositionCount());
235245
DoubleBlock.Builder pvalueBlockBuilder = blockFactory.newDoubleBlockBuilder(inputPage.getPositionCount())

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/topn/TopNOperator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ public void addInput(Page page) {
397397
spareKeysPreAllocSize = Math.max(spare.keys.length(), spareKeysPreAllocSize / 2);
398398
spareValuesPreAllocSize = Math.max(spare.values.length(), spareValuesPreAllocSize / 2);
399399

400-
String partition = partitionByChannel.isPresent() ? page.getBlock(partitionByChannel.get()).asVector().filter(i).toString() : "-default-";
400+
String partition = partitionByChannel.isPresent()
401+
? page.getBlock(partitionByChannel.get()).asVector().filter(i).toString()
402+
: "-default-";
401403
Queue inputQueue = inputQueues.get(partition);
402404
if (inputQueue == null) {
403405
inputQueues.put(partition, inputQueue = new Queue(topCount));

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ public PlanFactory visitChangePointCommand(EsqlBaseParser.ChangePointCommandCont
479479
Source src = source(ctx);
480480
Attribute value = visitQualifiedName(ctx.value);
481481
Attribute key = ctx.key == null ? new UnresolvedAttribute(src, "@timestamp") : visitQualifiedName(ctx.key);
482-
Attribute partitionField = ctx.partitionField == null ? new UnresolvedAttribute(src, "partitionField") : visitQualifiedName(ctx.partitionField);
482+
Attribute partitionField = ctx.partitionField == null
483+
? new UnresolvedAttribute(src, "partitionField")
484+
: visitQualifiedName(ctx.partitionField);
483485
Attribute targetType = new ReferenceAttribute(
484486
src,
485487
ctx.targetType == null ? "type" : visitQualifiedName(ctx.targetType).name(),

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/ChangePoint.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ public class ChangePoint extends UnaryPlan implements SurrogateLogicalPlan, Post
5151

5252
private List<Attribute> output;
5353

54-
public ChangePoint(Source source, LogicalPlan child, Attribute value, Attribute key, Attribute partitionField, Attribute targetType, Attribute targetPvalue) {
54+
public ChangePoint(
55+
Source source,
56+
LogicalPlan child,
57+
Attribute value,
58+
Attribute key,
59+
Attribute partitionField,
60+
Attribute targetType,
61+
Attribute targetPvalue
62+
) {
5563
super(source, child);
5664
this.value = value;
5765
this.key = key;
@@ -141,12 +149,12 @@ private Order order() {
141149
public LogicalPlan surrogate() {
142150
Order keyOrder = order();
143151

144-
// // The first Limit of N+1 data points is necessary to generate a possible warning,
145-
// Limit limit = new Limit(
146-
// source(),
147-
// new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT + 1, DataType.INTEGER),
148-
// orderBy
149-
// );
152+
// // The first Limit of N+1 data points is necessary to generate a possible warning,
153+
// Limit limit = new Limit(
154+
// source(),
155+
// new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT + 1, DataType.INTEGER),
156+
// orderBy
157+
// );
150158

151159
TopN topN = new TopN(
152160
source(),
@@ -156,11 +164,11 @@ public LogicalPlan surrogate() {
156164
new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT, DataType.INTEGER)
157165
);
158166

159-
160167
ChangePoint changePoint = new ChangePoint(source(), topN, value, key, partitionField, targetType, targetPvalue);
161168
return changePoint;
162-
// // The second Limit of N data points is to truncate the output.
163-
// return new Limit(source(), new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT, DataType.INTEGER), changePoint);
169+
// // The second Limit of N data points is to truncate the output.
170+
// return new Limit(source(), new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT, DataType.INTEGER),
171+
// changePoint);
164172
}
165173

166174
@Override

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/TopN.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.elasticsearch.common.io.stream.StreamInput;
1212
import org.elasticsearch.common.io.stream.StreamOutput;
1313
import org.elasticsearch.xpack.esql.core.capabilities.Resolvables;
14-
import org.elasticsearch.xpack.esql.core.expression.Attribute;
1514
import org.elasticsearch.xpack.esql.core.expression.Expression;
1615
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
1716
import org.elasticsearch.xpack.esql.core.tree.Source;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/physical/TopNExec.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ public class TopNExec extends UnaryExec implements EstimatesRowSize {
3939
*/
4040
private final Integer estimatedRowSize;
4141

42-
public TopNExec(Source source, PhysicalPlan child, List<Order> order, Expression limit, Integer estimatedRowSize, Expression partitionField) {
42+
public TopNExec(
43+
Source source,
44+
PhysicalPlan child,
45+
List<Order> order,
46+
Expression limit,
47+
Integer estimatedRowSize,
48+
Expression partitionField
49+
) {
4350
super(source, child);
4451
this.order = order;
4552
this.limit = limit;

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/plan/logical/TopNSerializationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ protected TopN mutateInstance(TopN instance) throws IOException {
4646
Expression limit = instance.limit();
4747
switch (between(0, 3)) {
4848
case 0 -> child = randomValueOtherThan(child, () -> randomChild(0));
49-
case 1 -> partitionField = randomValueOtherThan(partitionField, () -> new Literal(randomSource(), randomAlphaOfLengthBetween(1, 10), DataType.KEYWORD));
49+
case 1 -> partitionField = randomValueOtherThan(
50+
partitionField,
51+
() -> new Literal(randomSource(), randomAlphaOfLengthBetween(1, 10), DataType.KEYWORD)
52+
);
5053
case 2 -> order = randomValueOtherThan(order, TopNSerializationTests::randomOrders);
5154
case 3 -> limit = randomValueOtherThan(limit, AbstractExpressionSerializationTests::randomChild);
5255
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/plan/physical/TopNExecSerializationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ protected TopNExec mutateInstance(TopNExec instance) throws IOException {
4848
estimatedRowSize,
4949
AbstractPhysicalPlanSerializationTests::randomEstimatedRowSize
5050
);
51-
case 4 -> partitionField = randomValueOtherThan(partitionField, () -> new Literal(randomSource(), randomAlphaOfLengthBetween(1, 10), DataType.KEYWORD));
51+
case 4 -> partitionField = randomValueOtherThan(
52+
partitionField,
53+
() -> new Literal(randomSource(), randomAlphaOfLengthBetween(1, 10), DataType.KEYWORD)
54+
);
5255
default -> throw new UnsupportedOperationException();
5356
}
5457
return new TopNExec(instance.source(), child, order, limit, estimatedRowSize, partitionField);

0 commit comments

Comments
 (0)