Skip to content

Commit

Permalink
fix code too large
Browse files Browse the repository at this point in the history
  • Loading branch information
LiBinfeng-01 committed Nov 5, 2024
1 parent 3ac387e commit 9dacca5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.apache.doris.nereids.trees.expressions.WhenClause;
import org.apache.doris.nereids.trees.expressions.functions.BoundFunction;
import org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
import org.apache.doris.nereids.trees.expressions.functions.generator.TableGeneratingFunction;
import org.apache.doris.nereids.trees.expressions.functions.scalar.Array;
Expand Down Expand Up @@ -715,7 +716,8 @@ private Optional<Expression> preProcess(Expression expression) {
if (expression instanceof AggregateFunction || expression instanceof TableGeneratingFunction) {
return Optional.of(expression);
}
if (ExpressionUtils.hasNullLiteral(expression.getArguments()) && expression instanceof PropagateNullLiteral) {
if (ExpressionUtils.hasNullLiteral(expression.getArguments())
&& (expression instanceof PropagateNullLiteral || expression instanceof PropagateNullable)) {
return Optional.of(new NullLiteral(expression.getDataType()));
}
if (!ExpressionUtils.isAllLiteral(expression.getArguments())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* e.g. `substring(null, 1)` is nullable, `substring('abc', 1)` is not nullable.
*/
public interface PropagateNullable extends ComputeNullable, PropagateNullLiteral {
public interface PropagateNullable extends ComputeNullable {
@Override
default boolean nullable() {
return children().stream().anyMatch(Expression::nullable);
Expand Down

0 comments on commit 9dacca5

Please sign in to comment.