morrySnow commented on code in PR #11802: URL: https://github.com/apache/doris/pull/11802#discussion_r950979587
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ComparisonPredicate.java: ########## @@ -39,45 +37,21 @@ public abstract class ComparisonPredicate extends Expression implements BinaryEx * @param right right child of comparison predicate */ public ComparisonPredicate(Expression left, Expression right, String symbol) { - super(left, right); - this.symbol = symbol; + super(left, right, symbol); } @Override public DataType getDataType() throws UnboundException { return BooleanType.INSTANCE; } - @Override - public boolean nullable() throws UnboundException { - return left().nullable() || right().nullable(); - } - - @Override - public String toSql() { - return "(" + left().toSql() + ' ' + symbol + ' ' + right().toSql() + ")"; - } - public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { return visitor.visitComparisonPredicate(this, context); } @Override - public int hashCode() { - return Objects.hash(symbol, left(), right()); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComparisonPredicate other = (ComparisonPredicate) o; - return Objects.equals(left(), other.left()) - && Objects.equals(right(), other.right()); + public AbstractDataType inputType() { + return AnyDataType.INSTANCE; Review Comment: this is comparison, such as equalTo, so need BooleanType.INSTANCE -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org