Skip to content

Commit 223f5d6

Browse files
authored
ESQL: Fix DEBUG log of filter (#116086) (#116100)
This fixes thet `DEBUG` level logging of `WHERE`. Previously it was using a `ThrowingDriverContext` to render the description - but this throwing context will, well, throw if you touch it. This removes the `ThrowingDriverContext` entirely because it's never the right thing to use - instead we just use the `toString` of the factories. That works fine because we made sure that the factories had a nice `toString`. Closes #116055
1 parent 1224db9 commit 223f5d6

File tree

4 files changed

+19
-86
lines changed

4 files changed

+19
-86
lines changed

docs/changelog/116086.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 116086
2+
summary: "ESQL: Fix DEBUG log of filter"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 116055

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Operator get(DriverContext driverContext) {
2828

2929
@Override
3030
public String describe() {
31-
return "FilterOperator[evaluator=" + evaluatorSupplier.get(new ThrowingDriverContext()) + "]";
31+
return "FilterOperator[evaluator=" + evaluatorSupplier + "]";
3232
}
3333
}
3434

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

Lines changed: 0 additions & 84 deletions
This file was deleted.

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/FilterOperatorTests.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,18 @@ public void close() {}
5353

5454
@Override
5555
protected Operator.OperatorFactory simple() {
56-
return new FilterOperator.FilterOperatorFactory(dvrCtx -> new SameLastDigit(dvrCtx, 0, 1));
56+
return new FilterOperator.FilterOperatorFactory(new EvalOperator.ExpressionEvaluator.Factory() {
57+
58+
@Override
59+
public EvalOperator.ExpressionEvaluator get(DriverContext context) {
60+
return new SameLastDigit(context, 0, 1);
61+
}
62+
63+
@Override
64+
public String toString() {
65+
return "SameLastDigit[lhs=0, rhs=1]";
66+
}
67+
});
5768
}
5869

5970
@Override

0 commit comments

Comments
 (0)