This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new e19479e2e74 [fix](Nereids) json_object can't be odd parameters, need
even parameters (#31767) (#31907)
e19479e2e74 is described below
commit e19479e2e74a676eb450564cad0d7568169082a4
Author: Kang <[email protected]>
AuthorDate: Thu Mar 7 14:10:03 2024 +0800
[fix](Nereids) json_object can't be odd parameters, need even parameters
(#31767) (#31907)
Co-authored-by: zzwwhh <[email protected]>
---
.../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: [email protected]
For additional commands, e-mail: [email protected]