[bug](map-type)fix some bugs in map and map element function (#18935)

fix some bugs in map and map element function.
This commit is contained in:
xy720
2023-04-26 22:10:15 +08:00
committed by GitHub
parent aacc075f09
commit 925efc1902
5 changed files with 59 additions and 2 deletions

View File

@ -1461,6 +1461,13 @@ public class FunctionCallExpr extends Expr {
fn.getReturnType().getPrimitiveType().setTimeType();
}
if (fnName.getFunction().equalsIgnoreCase("map")) {
if ((children.size() & 1) == 1) {
throw new AnalysisException("map can't be odd parameters, need even parameters: "
+ this.toSql());
}
}
if (fnName.getFunction().equalsIgnoreCase("named_struct")) {
if ((children.size() & 1) == 1) {
throw new AnalysisException("named_struct can't be odd parameters, need even parameters: "