[fix](planner) fix ifnull and nvl function with one parameters exception message anbugious (#31808)
When ifnull or nvl funtion have only one parameter, nereids planner would throw an exception and go back to original planner/ Original planner get secend parameter directly without check, so it return unexpected error message
This commit is contained in:
@ -1543,6 +1543,8 @@ public class FunctionCallExpr extends Expr {
|
||||
|
||||
} else if (fnName.getFunction().equalsIgnoreCase("ifnull")
|
||||
|| fnName.getFunction().equalsIgnoreCase("nvl")) {
|
||||
Preconditions.checkArgument(children != null && children.size() == 2,
|
||||
"The " + fnName + " function must have two params");
|
||||
Type[] childTypes = collectChildReturnTypes();
|
||||
Type assignmentCompatibleType = ScalarType.getAssignmentCompatibleType(childTypes[0], childTypes[1], true,
|
||||
enableDecimal256);
|
||||
|
||||
Reference in New Issue
Block a user