Merged
Conversation
…ing create user-defined functions
…b.com/Realist007/ClickHouse into feature/create-simple-lambda-function
…a-function Feature/create simple lambda function
Member
|
We should add a test what happens when we call functions and delete function in parallel. |
958f65c to
6b2c249
Compare
amosbird
reviewed
Aug 20, 2021
| return true; | ||
| } | ||
|
|
||
| ASTPtr UserDefinedFunctionsMatcher::tryToReplaceFunction(const ASTFunction & function) |
Collaborator
There was a problem hiding this comment.
So it's still an AST-based solution. I think we can build a real function using ActionsDAG for lambdas.
Contributor
Author
There was a problem hiding this comment.
@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.
Collaborator
There was a problem hiding this comment.
Great. I'm also a fan of AST based solutions.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.