Code review comment: what about other nested types, map, struct,json?

Code before review:
public ScalarOperator visitCall(CallOperator call, ScalarOperatorRewriteContext context) {
Function fn = call.getFunction();
if (fn == null) {
for (int i = 0; i < call.getChildren().size(); ++i) {
Type type = call.getType();
if (!type.matchesType(call.getChild(i).getType())) {
addCastChild(type, call, i);
}
}
} else {
if (fn.functionName().equals(FunctionSet.ARRAY_MAP) ||
fn.functionName().equals(FunctionSet.EXCHANGE_BYTES) ||
fn.functionName().equals(FunctionSet.EXCHANGE_SPEED)) {
return call;
}
if (!call.isAggregate() || FunctionSet.AVG.equalsIgnoreCase(fn.functionName())) {
Preconditions.checkArgument(Arrays.stream(fn.getArgs()).noneMatch(Type::isWildcardDecimal),
String.format("Resolved function %s has wildcard decimal as argument type", fn.functionName()));
}
boolean needAdjustScale = ArithmeticExpr.DECIMAL_SCALE_ADJUST_OPERATOR_SET
.contains(fn.getFunctionName().getFunction());
for (int i = 0; i < fn.getNumArgs(); i++) {
Type type = fn.getArgs()[i];
ScalarOperator child = call.getChild(i);
if (type.isArrayType() && child.getType().isArrayType()
&& ((ArrayType) child.getType()).getItemType().isNull()) {
addCastChild(type, call, i);
continue;
}
if ((needAdjustScale && type.isDecimalOfAnyVersion() && !type.equals(child.getType())) ||
!type.matchesType(child.getType())) {
addCastChild(type, call, i);
}
}
if (fn.hasVarArgs() && call.getChildren().size() > fn.getNumArgs()) {
Type type = fn.getVarArgsType();
for (int i = fn.getNumArgs(); i < call.getChildren().size(); i++) {
ScalarOperator child = call.getChild(i);
if (!type.matchesType(child.getType())) {
addCastChild(type, call, i);
}
}
}
}
return call;
}

Line under review: }

Code after addressing the review:
public ScalarOperator visitCall(CallOperator call, ScalarOperatorRewriteContext context) {
Function fn = call.getFunction();
if (fn == null) {
for (int i = 0; i < call.getChildren().size(); ++i) {
Type type = call.getType();
if (!type.matchesType(call.getChild(i).getType())) {
addCastChild(type, call, i);
}
}
} else {
if (fn.functionName().equals(FunctionSet.ARRAY_MAP) ||
fn.functionName().equals(FunctionSet.EXCHANGE_BYTES) ||
fn.functionName().equals(FunctionSet.EXCHANGE_SPEED)) {
return call;
}
if (!call.isAggregate() || FunctionSet.AVG.equalsIgnoreCase(fn.functionName())) {
Preconditions.checkArgument(Arrays.stream(fn.getArgs()).noneMatch(Type::isWildcardDecimal),
String.format("Resolved function %s has wildcard decimal as argument type", fn.functionName()));
}
boolean needAdjustScale = ArithmeticExpr.DECIMAL_SCALE_ADJUST_OPERATOR_SET
.contains(fn.getFunctionName().getFunction());
for (int i = 0; i < fn.getNumArgs(); i++) {
Type type = fn.getArgs()[i];
ScalarOperator child = call.getChild(i);
if (needAdjustScale && type.isDecimalOfAnyVersion() && !type.equals(child.getType())) {
addCastChild(type, call, i);
continue;
}
if (!type.matchesType(child.getType())) {
addCastChild(type, call, i);
}
}
if (fn.hasVarArgs() && call.getChildren().size() > fn.getNumArgs()) {
Type type = fn.getVarArgsType();
for (int i = fn.getNumArgs(); i < call.getChildren().size(); i++) {
ScalarOperator child = call.getChild(i);
if (!type.matchesType(child.getType())) {
addCastChild(type, call, i);
}
}
}
}
return call;
}