Skip to content

Commit 5ba54a5

Browse files
add more comments
1 parent 41a493d commit 5ba54a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/local/LocalSubstituteSurrogateExpressionTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.elasticsearch.xpack.esql.optimizer.rules.logical.local;
99

1010
import org.elasticsearch.common.logging.LoggerMessageFormat;
11+
import org.elasticsearch.test.junit.annotations.TestLogging;
1112
import org.elasticsearch.xpack.esql.EsqlTestUtils;
1213
import org.elasticsearch.xpack.esql.core.expression.Alias;
1314
import org.elasticsearch.xpack.esql.core.expression.Expression;
@@ -33,7 +34,7 @@
3334
import static org.elasticsearch.xpack.esql.EsqlTestUtils.as;
3435
import static org.elasticsearch.xpack.esql.core.type.DataType.DATETIME;
3536

36-
//@TestLogging(value = "org.elasticsearch.xpack.esql:TRACE", reason = "debug")
37+
@TestLogging(value = "org.elasticsearch.xpack.esql:TRACE", reason = "debug")
3738
public class LocalSubstituteSurrogateExpressionTests extends LocalLogicalPlanOptimizerTests {
3839

3940
// Key is the predicate,
@@ -58,10 +59,11 @@ public class LocalSubstituteSurrogateExpressionTests extends LocalLogicalPlanOpt
5859

5960
private static final Map<String, Integer> evalRenamePredicatesWithDateTruncBucket = new HashMap<>(
6061
Map.ofEntries(
61-
// ReplaceAliasingEvalWithProject replaces x with hire_date so that the date_trunc can be transformed to round_to
62+
// ReplaceAliasingEvalWithProject replaces x with hire_date so that the DateTrunc can be transformed to RoundTo
6263
Map.entry(" | eval x = hire_date ", 4),
6364
// DateTrunc cannot be transformed to RoundTo if it references an expression
6465
Map.entry(" | eval x = hire_date + 1 year ", -1),
66+
// PushDownEval replaces the reference(x) in DateTrunc with the corresponding field hire_date
6567
Map.entry(" | rename hire_date as x ", 4),
6668
Map.entry(" | rename hire_date as a, a as x ", 4),
6769
Map.entry(" | rename hire_date as x, x as hire_date ", 4),

0 commit comments

Comments
 (0)