This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit c7d86c062ad39edf16c5ed251e098ba925f00bd9 Author: zzwwhh <30350667+iwanttobepower...@users.noreply.github.com> AuthorDate: Wed Mar 6 20:37:48 2024 +0800 [fix](Nereids) json_object can't be odd parameters, need even parameters (#31767) --- .../doris/nereids/trees/expressions/functions/scalar/JsonObject.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/JsonObject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/JsonObject.java index e1e2c961ef2..6d3d1536eb8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/JsonObject.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/JsonObject.java @@ -49,6 +49,9 @@ public class JsonObject extends ScalarFunction @Override public void checkLegalityBeforeTypeCoercion() { + if ((arity() & 1) == 1) { + throw new AnalysisException("json_object can't be odd parameters, need even parameters: " + this.toSql()); + } for (int i = 0; i < arity(); i++) { if ((i & 1) == 0 && getArgumentType(i).isNullType()) { throw new AnalysisException("json_object key can't be NULL: " + this.toSql()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org