ChenMiaoi commented on code in PR #50151: URL: https://github.com/apache/doris/pull/50151#discussion_r2055331745
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/JsonSearch.java: ########## @@ -37,22 +37,42 @@ public class JsonSearch extends ScalarFunction implements ExplicitlyCastableSign public static final List<FunctionSignature> SIGNATURES = ImmutableList.of( FunctionSignature.ret(JsonType.INSTANCE) - .args(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT) + .args(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT), + FunctionSignature.ret(JsonType.INSTANCE) + .args(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, + VarcharType.SYSTEM_DEFAULT), + FunctionSignature.ret(JsonType.INSTANCE) + .args(VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT, + VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT) ); public JsonSearch(Expression arg0, Expression arg1, Expression arg2) { super("json_search", arg0, arg1, arg2); } + public JsonSearch(Expression arg0, Expression arg1, Expression arg2, Expression arg3) { + super("json_search", arg0, arg1, arg2, arg3); + } + + public JsonSearch(Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4) { + super("json_search", arg0, arg1, arg2, arg3, arg4); + } + @Override public List<FunctionSignature> getSignatures() { return SIGNATURES; } @Override public JsonSearch withChildren(List<Expression> children) { - Preconditions.checkArgument(children.size() == 3); - return new JsonSearch(children.get(0), children.get(1), children.get(2)); + Preconditions.checkArgument(children.size() == 3 || children.size() == 4 || children.size() == 5); + if (children.size() == 3) { + return new JsonSearch(children.get(0), children.get(1), children.get(2)); + } else if (children.size() == 4) { Review Comment: done the default value `escape_char = '\\'`, I do the check at be, not fe. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org