englefly commented on code in PR #18299:
URL: https://github.com/apache/doris/pull/18299#discussion_r1155061151
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalJoin.java:
##########
@@ -242,74 +242,63 @@ public RIGHT_CHILD_TYPE right() {
@Override
public LogicalJoin<Plan, Plan> withChildren(List<Plan> children) {
Preconditions.checkArgument(children.size() == 2);
- return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint,
- markJoinSlotReference, children.get(0),
- children.get(1), joinReorderContext);
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
+ Optional.empty(), Optional.empty(), children.get(0),
children.get(1), joinReorderContext);
}
@Override
public LogicalJoin<Plan, Plan>
withGroupExpression(Optional<GroupExpression> groupExpression) {
- LogicalJoin<Plan, Plan> newJoin = new LogicalJoin<>(joinType,
hashJoinConjuncts, otherJoinConjuncts, hint,
- markJoinSlotReference,
- groupExpression, Optional.of(getLogicalProperties()), left(),
right());
- newJoin.getJoinReorderContext().copyFrom(this.getJoinReorderContext());
- return newJoin;
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
+ groupExpression, Optional.of(getLogicalProperties()), left(),
right(), joinReorderContext);
}
@Override
public LogicalJoin<Plan, Plan>
withLogicalProperties(Optional<LogicalProperties> logicalProperties) {
- LogicalJoin<Plan, Plan> newJoin = new LogicalJoin<>(joinType,
hashJoinConjuncts, otherJoinConjuncts, hint,
- markJoinSlotReference,
- Optional.empty(), logicalProperties, left(), right());
- newJoin.getJoinReorderContext().copyFrom(this.getJoinReorderContext());
- return newJoin;
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
+ Optional.empty(), logicalProperties, left(), right(),
joinReorderContext);
+ }
+
+ public LogicalJoin withChildrenNoContext(Plan left, Plan right) {
Review Comment:
do we still need withChildren() ?
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalJoin.java:
##########
@@ -242,74 +242,63 @@ public RIGHT_CHILD_TYPE right() {
@Override
public LogicalJoin<Plan, Plan> withChildren(List<Plan> children) {
Preconditions.checkArgument(children.size() == 2);
- return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint,
- markJoinSlotReference, children.get(0),
- children.get(1), joinReorderContext);
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
+ Optional.empty(), Optional.empty(), children.get(0),
children.get(1), joinReorderContext);
}
@Override
public LogicalJoin<Plan, Plan>
withGroupExpression(Optional<GroupExpression> groupExpression) {
- LogicalJoin<Plan, Plan> newJoin = new LogicalJoin<>(joinType,
hashJoinConjuncts, otherJoinConjuncts, hint,
- markJoinSlotReference,
- groupExpression, Optional.of(getLogicalProperties()), left(),
right());
- newJoin.getJoinReorderContext().copyFrom(this.getJoinReorderContext());
- return newJoin;
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
+ groupExpression, Optional.of(getLogicalProperties()), left(),
right(), joinReorderContext);
}
@Override
public LogicalJoin<Plan, Plan>
withLogicalProperties(Optional<LogicalProperties> logicalProperties) {
- LogicalJoin<Plan, Plan> newJoin = new LogicalJoin<>(joinType,
hashJoinConjuncts, otherJoinConjuncts, hint,
- markJoinSlotReference,
- Optional.empty(), logicalProperties, left(), right());
- newJoin.getJoinReorderContext().copyFrom(this.getJoinReorderContext());
- return newJoin;
+ return new LogicalJoin<>(joinType, hashJoinConjuncts,
otherJoinConjuncts, hint, markJoinSlotReference,
Review Comment:
two joins share one joinReorderContext. is it safe?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]