Skip to content

Commit a707bec

Browse files
committed
Make equals include ids for Alias, TypedAttribute
1 parent c47522c commit a707bec

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/Alias.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.io.IOException;
1919
import java.util.List;
20+
import java.util.Objects;
2021

2122
import static java.util.Collections.singletonList;
2223

@@ -147,4 +148,10 @@ public String nodeString() {
147148
public static Expression unwrap(Expression e) {
148149
return e instanceof Alias as ? as.child() : e;
149150
}
151+
152+
@Override
153+
protected boolean innerEquals(Object o) {
154+
var other = (Alias) o;
155+
return super.innerEquals(other) && Objects.equals(id(), other.id());
156+
}
150157
}

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/TypedAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public int hashCode() {
5454
@Override
5555
protected boolean innerEquals(Object o) {
5656
var other = (TypedAttribute) o;
57-
return super.innerEquals(other) && dataType == other.dataType;
57+
return super.innerEquals(other) && Objects.equals(id(), other.id()) && dataType == other.dataType;
5858
}
5959
}

0 commit comments

Comments
 (0)