Skip to content

Commit faea78b

Browse files
committed
refactor(esql): Improve MvExpand push-down logic in PushDownMvExpandPastProject
- Refactor condition in semantic equality check for MvExpand push-down - Modify logic to handle alias comparisons more precisely - Simplify condition for checking input references in project operations - Improve code readability and reduce complexity of push-down rule
1 parent 8e69eb0 commit faea78b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/PushDownMvExpandPastProject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected LogicalPlan rule(MvExpand mvExpand) {
4949
if (projections.stream()
5050
.anyMatch(
5151
ne -> ne.semanticEquals(alias.child())
52-
|| ne != alias && ne instanceof Alias as && as.child().semanticEquals(alias.child())
52+
|| ne instanceof Alias as && as.child().semanticEquals(alias.child()) && as != alias
5353
) == false) {
5454
// The alias's original field is not referenced elsewhere, no need to preserve it,
5555
mvExpand = PushDownUtils.resolveRenamesFromProject(mvExpand, pj);

0 commit comments

Comments
 (0)