Skip to content

Commit 1cf34bc

Browse files
Address code review comments
1 parent ec7f10a commit 1cf34bc

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ static TransportVersion def(int id) {
362362
public static final TransportVersion SIMULATE_INGEST_MAPPING_MERGE_TYPE = def(9_138_0_00);
363363
public static final TransportVersion ESQL_LOOKUP_JOIN_ON_MANY_FIELDS = def(9_139_0_00);
364364

365-
366365
/*
367366
* STOP! READ THIS FIRST! No, really,
368367
* ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public int getPositionCount() {
4848
int positionCount = queryLists.get(0).getPositionCount();
4949
for (QueryList queryList : queryLists) {
5050
if (queryList.getPositionCount() != positionCount) {
51-
throw new IllegalArgumentException(
51+
throw new IllegalStateException(
5252
"All QueryLists must have the same position count, expected: "
5353
+ positionCount
5454
+ ", but got: "

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/FirstLongByTimestampAggregatorFunctionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.elasticsearch.compute.data.LongBlock;
1515
import org.elasticsearch.compute.data.Page;
1616
import org.elasticsearch.compute.operator.SourceOperator;
17-
import org.elasticsearch.compute.operator.TupleLongLongBlockSourceOperator;
17+
import org.elasticsearch.compute.test.TupleLongLongBlockSourceOperator;
1818
import org.elasticsearch.core.Tuple;
1919

2020
import java.util.List;

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/LastLongByTimestampAggregatorFunctionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.elasticsearch.compute.data.LongBlock;
1515
import org.elasticsearch.compute.data.Page;
1616
import org.elasticsearch.compute.operator.SourceOperator;
17-
import org.elasticsearch.compute.operator.TupleLongLongBlockSourceOperator;
17+
import org.elasticsearch.compute.test.TupleLongLongBlockSourceOperator;
1818
import org.elasticsearch.core.Tuple;
1919

2020
import java.util.List;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexOperator.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,28 +239,28 @@ public static class Status extends AsyncOperator.Status {
239239
Status::new
240240
);
241241

242-
private final long totalTerms;
242+
private final long totalRows;
243243
/**
244244
* Total number of pages emitted by this {@link Operator}.
245245
*/
246246
private final long emittedPages;
247247

248-
Status(long receivedPages, long completedPages, long totalTimeInMillis, long totalTerms, long emittedPages) {
248+
Status(long receivedPages, long completedPages, long totalTimeInMillis, long totalRows, long emittedPages) {
249249
super(receivedPages, completedPages, totalTimeInMillis);
250-
this.totalTerms = totalTerms;
250+
this.totalRows = totalRows;
251251
this.emittedPages = emittedPages;
252252
}
253253

254254
Status(StreamInput in) throws IOException {
255255
super(in);
256-
this.totalTerms = in.readVLong();
256+
this.totalRows = in.readVLong();
257257
this.emittedPages = in.readVLong();
258258
}
259259

260260
@Override
261261
public void writeTo(StreamOutput out) throws IOException {
262262
super.writeTo(out);
263-
out.writeVLong(totalTerms);
263+
out.writeVLong(totalRows);
264264
out.writeVLong(emittedPages);
265265
}
266266

@@ -273,16 +273,16 @@ public long emittedPages() {
273273
return emittedPages;
274274
}
275275

276-
public long totalTerms() {
277-
return totalTerms;
276+
public long totalRows() {
277+
return totalRows;
278278
}
279279

280280
@Override
281281
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
282282
builder.startObject();
283283
super.innerToXContent(builder);
284284
builder.field("emitted_pages", emittedPages());
285-
builder.field("total_terms", totalTerms());
285+
builder.field("total_rows", totalRows());
286286
return builder.endObject();
287287
}
288288

@@ -295,12 +295,12 @@ public boolean equals(Object o) {
295295
return false;
296296
}
297297
Status status = (Status) o;
298-
return totalTerms == status.totalTerms && emittedPages == status.emittedPages;
298+
return totalRows == status.totalRows && emittedPages == status.emittedPages;
299299
}
300300

301301
@Override
302302
public int hashCode() {
303-
return Objects.hash(super.hashCode(), totalTerms, emittedPages);
303+
return Objects.hash(super.hashCode(), totalRows, emittedPages);
304304
}
305305
}
306306

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexOperatorStatusTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected LookupFromIndexOperator.Status mutateInstance(LookupFromIndexOperator.
3939
long receivedPages = in.receivedPages();
4040
long completedPages = in.completedPages();
4141
long procesNanos = in.procesNanos();
42-
long totalTerms = in.totalTerms();
42+
long totalTerms = in.totalRows();
4343
long emittedPages = in.emittedPages();
4444
switch (randomIntBetween(0, 4)) {
4545
case 0 -> receivedPages = randomValueOtherThan(receivedPages, ESTestCase::randomNonNegativeLong);
@@ -62,7 +62,7 @@ public void testToXContent() {
6262
"received_pages" : 100,
6363
"completed_pages" : 50,
6464
"emitted_pages" : 88,
65-
"total_terms" : 120
65+
"total_rows" : 120
6666
}"""));
6767
}
6868
}

0 commit comments

Comments
 (0)