Skip to content

Commit c460aec

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 76e3726 commit c460aec

File tree

2 files changed

+31
-4
lines changed
  • x-pack/plugin/esql/src
    • main/java/org/elasticsearch/xpack/esql/expression/function/grouping
    • test/java/org/elasticsearch/xpack/esql/expression/function

2 files changed

+31
-4
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Bucket.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,13 @@ private Bucket(StreamInput in) throws IOException {
239239
);
240240
}
241241

242-
private static List<Expression> fields(Expression field, Expression buckets, Expression from, Expression to, Expression emitEmptyBuckets) {
242+
private static List<Expression> fields(
243+
Expression field,
244+
Expression buckets,
245+
Expression from,
246+
Expression to,
247+
Expression emitEmptyBuckets
248+
) {
243249
List<Expression> list = new ArrayList<>(4);
244250
list.add(field);
245251
list.add(buckets);
@@ -272,7 +278,11 @@ public String getWriteableName() {
272278

273279
@Override
274280
public boolean foldable() {
275-
return field.foldable() && buckets.foldable() && (from == null || from.foldable()) && (to == null || to.foldable()) && (emitEmptyBuckets == null || emitEmptyBuckets.foldable());
281+
return field.foldable()
282+
&& buckets.foldable()
283+
&& (from == null || from.foldable())
284+
&& (to == null || to.foldable())
285+
&& (emitEmptyBuckets == null || emitEmptyBuckets.foldable());
276286
}
277287

278288
@Override
@@ -504,6 +514,17 @@ public Expression emitEmptyBuckets() {
504514

505515
@Override
506516
public String toString() {
507-
return "Bucket{" + "field=" + field + ", buckets=" + buckets + ", from=" + from + ", to=" + to + ", emitEmptyBuckets=" + emitEmptyBuckets + '}';
517+
return "Bucket{"
518+
+ "field="
519+
+ field
520+
+ ", buckets="
521+
+ buckets
522+
+ ", from="
523+
+ from
524+
+ ", to="
525+
+ to
526+
+ ", emitEmptyBuckets="
527+
+ emitEmptyBuckets
528+
+ '}';
508529
}
509530
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/RailRoadDiagram.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ static String functionSignature(FunctionDefinition definition) throws IOExceptio
7575
var nexterArg = args.get(++i);
7676
assert nexterArg.optional();
7777
// TODO: Should it be possible to be able to specify "emitEmptyBuckets" but not "from" and "to"?
78-
Sequence seq = new Sequence(new Literal(argName), new Syntax(","), new Literal(nextArg.name), new Syntax(","), new Literal(nexterArg.name));
78+
Sequence seq = new Sequence(
79+
new Literal(argName),
80+
new Syntax(","),
81+
new Literal(nextArg.name),
82+
new Syntax(","),
83+
new Literal(nexterArg.name)
84+
);
7985
argExpressions.add(new Repetition(seq, 0, 1));
8086
} else if (i < args.size() - 1 && args.get(i + 1).optional() == false) {
8187
// Special case with leading optional args

0 commit comments

Comments
 (0)