morrySnow commented on code in PR #48037: URL: https://github.com/apache/doris/pull/48037#discussion_r2101559536
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Add.java: ########## @@ -63,4 +67,31 @@ public DataType getDataTypeForOthers(DataType t1, DataType t2) { public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) { return visitor.visitAdd(this, context); } + + @Override + public boolean isMonotonic(Literal lower, Literal upper) { + return !(child(0) instanceof Literal) && child(1) instanceof Literal + || child(0) instanceof Literal && !(child(1) instanceof Literal); + } + + @Override + public boolean isPositive() { + return true; + } + + @Override + public int getMonotonicFunctionChildIndex() { + return child(1) instanceof Literal ? 0 : 1; + } + + @Override + public boolean isStrictlyMonotonic() { + return !(getDataType() instanceof DoubleType) && !(getDataType() instanceof FloatType) + && isMonotonic(null, null); Review Comment: what's this mean? ########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java: ########## @@ -97,4 +98,21 @@ default boolean isDeterministic() { default boolean containsNondeterministic() { return anyMatch(expr -> !((ExpressionTrait) expr).isDeterministic()); } + + /** strictlyMonotonic */ + default boolean strictlyMonotonic() { + // ε εΊιε Review Comment: use english -- 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