Copilot commented on code in PR #50894:
URL: https://github.com/apache/doris/pull/50894#discussion_r2088325756
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java:
##########
@@ -73,75 +65,64 @@ public DataType getDataType() throws UnboundException {
@Override
public boolean nullable() throws UnboundException {
- return super.nullable() || this.compareExpr.nullable();
+ return super.nullable() || this.child().nullable();
}
@Override
public String computeToSql() {
- return this.compareExpr.toSql() + " IN (" + super.computeToSql() + ")";
+ return this.child().toSql() + " IN (" + super.computeToSql() + ")";
}
@Override
public String toString() {
- return this.compareExpr + " IN (INSUBQUERY) " + super.toString();
+ return this.child() + " IN (INSUBQUERY) " + super.toString();
}
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitInSubquery(this, context);
}
public Expression getCompareExpr() {
- return this.compareExpr;
+ return this.child();
}
public boolean isNot() {
return isNot;
}
- public ListQuery getListQuery() {
- return listQuery;
- }
-
@Override
public InSubquery withChildren(List<Expression> children) {
- Preconditions.checkArgument(children.size() == 2);
- Preconditions.checkArgument(children.get(1) instanceof ListQuery);
- return new InSubquery(children.get(0), (ListQuery) children.get(1),
correlateSlots, typeCoercionExpr, isNot);
- }
-
- @Override
- public List<Expression> children() {
- return Lists.newArrayList(compareExpr, listQuery);
+ Preconditions.checkArgument(children.size() == 1);
+ return new InSubquery(children.get(0), queryPlan, correlateSlots,
typeCoercionExpr, isNot);
Review Comment:
The children() method should return a List<Expression>, but it is currently
returning an InSubquery instance. Consider returning a list containing the
child expression (e.g., ImmutableList.of(child())).
--
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]