Skip to content

Commit 37c3be2

Browse files
committed
spotless
1 parent ea24893 commit 37c3be2

File tree

6 files changed

+28
-24
lines changed

6 files changed

+28
-24
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ private void createOutputPages() {
167167
warnings(false).registerException(new IllegalArgumentException(indeterminable.getReason()));
168168
}
169169
if (tooManyValues) {
170-
warnings(true).registerException(new IllegalArgumentException("too many values; keeping only first " + INPUT_VALUE_COUNT_LIMIT + " values"));
170+
warnings(true).registerException(
171+
new IllegalArgumentException("too many values; keeping only first " + INPUT_VALUE_COUNT_LIMIT + " values")
172+
);
171173
}
172174
if (hasNulls) {
173175
warnings(true).registerException(new IllegalArgumentException("values contain nulls; treating them as zeroes"));

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,7 @@ private static Warnings createWarnings(
9696

9797
private Warnings(int lineNumber, int columnNumber, String sourceText, String first) {
9898
this.location = format("Line {}:{}: ", lineNumber, columnNumber);
99-
this.first = format(
100-
null,
101-
"{}" + first + ". Only first {} failures recorded.",
102-
location,
103-
sourceText,
104-
MAX_ADDED_WARNINGS
105-
);
99+
this.first = format(null, "{}" + first + ". Only first {} failures recorded.", location, sourceText, MAX_ADDED_WARNINGS);
106100
}
107101

108102
public void registerException(Exception exception) {

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,28 @@ public PlanFactory visitChangePointCommand(EsqlBaseParser.ChangePointCommandCont
456456
Source src = source(ctx);
457457
NamedExpression value = visitQualifiedName(ctx.value);
458458
NamedExpression key = ctx.key == null ? new UnresolvedAttribute(src, "@timestamp") : visitQualifiedName(ctx.key);
459-
Attribute targetType = new ReferenceAttribute(src, ctx.targetType == null ? "type" : visitQualifiedName(ctx.targetType).name(), DataType.KEYWORD);
460-
Attribute targetPvalue = new ReferenceAttribute(src, ctx.targetPvalue == null ? "pvalue" : visitQualifiedName(ctx.targetPvalue).name(), DataType.DOUBLE);
459+
Attribute targetType = new ReferenceAttribute(
460+
src,
461+
ctx.targetType == null ? "type" : visitQualifiedName(ctx.targetType).name(),
462+
DataType.KEYWORD
463+
);
464+
Attribute targetPvalue = new ReferenceAttribute(
465+
src,
466+
ctx.targetPvalue == null ? "pvalue" : visitQualifiedName(ctx.targetPvalue).name(),
467+
DataType.DOUBLE
468+
);
461469
return child -> {
462470
// ChangePoint should always run on the coordinating node after the data is collected
463471
// in sorted order. This is enforced by adding OrderBy here.
464472
// Furthermore, ChangePoint should be called with at most 1000 data points. That's
465473
// enforced by the Limits here. The first Limit of 1001 data points is necessary to
466474
// generate a possible warning, the second Limit of 1000 is to truncate the output.
467475
OrderBy orderBy = new OrderBy(src, child, List.of(new Order(src, key, Order.OrderDirection.ASC, Order.NullsPosition.ANY)));
468-
Limit limit = new Limit(src, new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT + 1, DataType.INTEGER), orderBy);
476+
Limit limit = new Limit(
477+
src,
478+
new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT + 1, DataType.INTEGER),
479+
orderBy
480+
);
469481
ChangePoint changePoint = new ChangePoint(src, limit, value, key, targetType, targetPvalue);
470482
return new Limit(src, new Literal(Source.EMPTY, ChangePointOperator.INPUT_VALUE_COUNT_LIMIT, DataType.INTEGER), changePoint);
471483

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,15 @@ private PhysicalOperation planMvExpand(MvExpandExec mvExpandExec, LocalExecution
705705
private PhysicalOperation planChangePoint(ChangePointExec changePoint, LocalExecutionPlannerContext context) {
706706
PhysicalOperation source = plan(changePoint.child(), context);
707707
Layout layout = source.layout.builder().append(changePoint.targetType()).append(changePoint.targetPvalue()).build();
708-
return source.with(new ChangePointOperator.Factory(layout.get(changePoint.value().id()).channel(), changePoint.sourceText(), changePoint.sourceLocation().getLineNumber(), changePoint.sourceLocation().getColumnNumber()), layout);
708+
return source.with(
709+
new ChangePointOperator.Factory(
710+
layout.get(changePoint.value().id()).channel(),
711+
changePoint.sourceText(),
712+
changePoint.sourceLocation().getLineNumber(),
713+
changePoint.sourceLocation().getColumnNumber()
714+
),
715+
layout
716+
);
709717
}
710718

711719
/**

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper/LocalMapper.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111
import org.elasticsearch.index.IndexMode;
1212
import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
1313
import org.elasticsearch.xpack.esql.core.expression.Attribute;
14-
import org.elasticsearch.xpack.esql.core.expression.Literal;
15-
import org.elasticsearch.xpack.esql.core.tree.Source;
16-
import org.elasticsearch.xpack.esql.core.type.DataType;
17-
import org.elasticsearch.xpack.esql.expression.Order;
1814
import org.elasticsearch.xpack.esql.plan.logical.Aggregate;
1915
import org.elasticsearch.xpack.esql.plan.logical.BinaryPlan;
20-
import org.elasticsearch.xpack.esql.plan.logical.ChangePoint;
2116
import org.elasticsearch.xpack.esql.plan.logical.EsRelation;
2217
import org.elasticsearch.xpack.esql.plan.logical.LeafPlan;
2318
import org.elasticsearch.xpack.esql.plan.logical.Limit;
@@ -28,7 +23,6 @@
2823
import org.elasticsearch.xpack.esql.plan.logical.join.Join;
2924
import org.elasticsearch.xpack.esql.plan.logical.join.JoinConfig;
3025
import org.elasticsearch.xpack.esql.plan.logical.join.JoinTypes;
31-
import org.elasticsearch.xpack.esql.plan.physical.ChangePointExec;
3226
import org.elasticsearch.xpack.esql.plan.physical.EsSourceExec;
3327
import org.elasticsearch.xpack.esql.plan.physical.HashJoinExec;
3428
import org.elasticsearch.xpack.esql.plan.physical.LimitExec;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper/Mapper.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@
1111
import org.elasticsearch.index.IndexMode;
1212
import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
1313
import org.elasticsearch.xpack.esql.core.expression.Attribute;
14-
import org.elasticsearch.xpack.esql.core.expression.Literal;
15-
import org.elasticsearch.xpack.esql.core.tree.Source;
16-
import org.elasticsearch.xpack.esql.core.type.DataType;
1714
import org.elasticsearch.xpack.esql.core.util.Holder;
18-
import org.elasticsearch.xpack.esql.expression.Order;
1915
import org.elasticsearch.xpack.esql.plan.logical.Aggregate;
2016
import org.elasticsearch.xpack.esql.plan.logical.BinaryPlan;
21-
import org.elasticsearch.xpack.esql.plan.logical.ChangePoint;
2217
import org.elasticsearch.xpack.esql.plan.logical.Enrich;
2318
import org.elasticsearch.xpack.esql.plan.logical.EsRelation;
2419
import org.elasticsearch.xpack.esql.plan.logical.LeafPlan;
@@ -30,7 +25,6 @@
3025
import org.elasticsearch.xpack.esql.plan.logical.join.Join;
3126
import org.elasticsearch.xpack.esql.plan.logical.join.JoinConfig;
3227
import org.elasticsearch.xpack.esql.plan.logical.join.JoinTypes;
33-
import org.elasticsearch.xpack.esql.plan.physical.ChangePointExec;
3428
import org.elasticsearch.xpack.esql.plan.physical.EnrichExec;
3529
import org.elasticsearch.xpack.esql.plan.physical.ExchangeExec;
3630
import org.elasticsearch.xpack.esql.plan.physical.FragmentExec;

0 commit comments

Comments
 (0)