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
Merging #23978 #27796
Merging #23978 #27796
Conversation
…ing create user-defined functions
…b.com/Realist007/ClickHouse into feature/create-simple-lambda-function
…a-function Feature/create simple lambda function
We should add a test what happens when we call functions and delete function in parallel. |
958f65c
to
6b2c249
Compare
return true; | ||
} | ||
|
||
ASTPtr UserDefinedFunctionsMatcher::tryToReplaceFunction(const ASTFunction & function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's still an AST-based solution. I think we can build a real function using ActionsDAG for lambdas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amosbird it will be weaker solution, because for example client created function.
CREATE FUNCTION test_func (a, b) -> a + b;
It is used like
SELECT test_func(a, b) + c;
In our solution it will be substituted and whole expression can be optimised later for example JIT compiled. There are much more cases when we get benefits from substitution, this one is the simples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I'm also a fan of AST based solutions.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Original pull request #23978.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add feature for creating user-defined functions as lambda expressions. Syntax
CREATE FUNCTION {function_name} as ({parameters}) -> {function core}
. ExampleCREATE FUNCTION plus_one as (a) -> a + 1
. Authors @Realist007.