Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] BuiltinFunctionName does not include all built-in functions #1051

Open
LantaoJin opened this issue Feb 14, 2025 · 3 comments
Open
Labels
maintenance Code refactoring

Comments

@LantaoJin
Copy link
Member

What is the bug?
BuiltinFunctionName should include all built-in functions. But some implemented functions such as JSON_DELETE, JSON_APPEND are not included in this file.

JSON_KEYS(FunctionName.of("json_keys")),
JSON_VALID(FunctionName.of("json_valid")),
// JSON_DELETE(FunctionName.of("json_delete")),
// JSON_APPEND(FunctionName.of("json_append")),
// JSON_EXTEND(FunctionName.of("json_extend")),

It because that the following code is handling this missing functions:

static Expression builtinFunction(org.opensearch.sql.ast.expression.Function function, List<Expression> args) {
if (BuiltinFunctionName.of(function.getFuncName()).isEmpty()) {
ScalaUDF udf = SerializableUdf.visit(function.getFuncName(), args);
if(udf == null) {
throw new UnsupportedOperationException(function.getFuncName() + " is not a builtin function of PPL");
}
return udf;

BuiltinFunctionName should include all built-in function of PPL-on-Spark. We need to provide a code refactor.

@LantaoJin LantaoJin added bug Something isn't working untriaged labels Feb 14, 2025
@ykmr1224
Copy link
Collaborator

@LantaoJin Is it more like an enhancement?

@LantaoJin LantaoJin added maintenance Code refactoring and removed bug Something isn't working labels Feb 19, 2025
@LantaoJin
Copy link
Member Author

It's a code refactor work. @qianheng-aws are you interested in contributing this?

@qianheng-aws
Copy link
Contributor

It's a code refactor work. @qianheng-aws are you interested in contributing this?

Yeah, glad to contribute. Will do that work in this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code refactoring
Projects
None yet
Development

No branches or pull requests

3 participants