Skip to content

Commit bc1a6ec

Browse files
committed
Revert JoinConfig back to Record
1 parent ea6f6b9 commit bc1a6ec

File tree

1 file changed

+8
-52
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/join

1 file changed

+8
-52
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/join/JoinConfig.java

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,24 @@
1111
import org.elasticsearch.common.io.stream.StreamInput;
1212
import org.elasticsearch.common.io.stream.StreamOutput;
1313
import org.elasticsearch.common.io.stream.Writeable;
14+
import org.elasticsearch.core.Nullable;
1415
import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException;
1516
import org.elasticsearch.xpack.esql.core.capabilities.Resolvables;
1617
import org.elasticsearch.xpack.esql.core.expression.Attribute;
1718
import org.elasticsearch.xpack.esql.core.expression.Expression;
1819

1920
import java.io.IOException;
2021
import java.util.List;
21-
import java.util.Objects;
2222

2323
/**
24-
* Configuration for a {@code JOIN} style operation.
24+
* @param type type of join
25+
* @param leftFields fields from the left child to join on
26+
* @param rightFields fields from the right child to join on
27+
* @param joinOnConditions join conditions for expression based joins. If null, we assume equi-join on the left/right fields
2528
*/
26-
public final class JoinConfig implements Writeable {
27-
private final JoinType type;
28-
private final List<Attribute> leftFields;
29-
private final List<Attribute> rightFields;
30-
private final Expression joinOnConditions;
31-
32-
/**
33-
* @param type type of join
34-
* @param leftFields fields from the left child to join on
35-
* @param rightFields fields from the right child to join on
36-
* @param joinOnConditions join conditions for expression based joins. If null, we assume equi-join on the left/right fields
37-
*/
38-
public JoinConfig(JoinType type, List<Attribute> leftFields, List<Attribute> rightFields, Expression joinOnConditions) {
39-
this.type = type;
40-
this.leftFields = leftFields;
41-
this.rightFields = rightFields;
42-
this.joinOnConditions = joinOnConditions;
43-
}
29+
public record JoinConfig(JoinType type, List<Attribute> leftFields, List<Attribute> rightFields, @Nullable Expression joinOnConditions)
30+
implements
31+
Writeable {
4432

4533
/**
4634
* Legacy constructor that included the match fields, which were always the left fields.
@@ -97,38 +85,6 @@ public boolean expressionsResolved() {
9785
&& (joinOnConditions == null || joinOnConditions.resolved());
9886
}
9987

100-
public JoinType type() {
101-
return type;
102-
}
103-
104-
public List<Attribute> leftFields() {
105-
return leftFields;
106-
}
107-
108-
public List<Attribute> rightFields() {
109-
return rightFields;
110-
}
111-
112-
public Expression joinOnConditions() {
113-
return joinOnConditions;
114-
}
115-
116-
@Override
117-
public boolean equals(Object obj) {
118-
if (obj == this) return true;
119-
if (obj == null || obj.getClass() != this.getClass()) return false;
120-
var that = (JoinConfig) obj;
121-
return Objects.equals(this.type, that.type)
122-
&& Objects.equals(this.leftFields, that.leftFields)
123-
&& Objects.equals(this.rightFields, that.rightFields)
124-
&& Objects.equals(this.joinOnConditions, that.joinOnConditions);
125-
}
126-
127-
@Override
128-
public int hashCode() {
129-
return Objects.hash(type, leftFields, rightFields, joinOnConditions);
130-
}
131-
13288
@Override
13389
public String toString() {
13490
return "JoinConfig["

0 commit comments

Comments
 (0)