-
Notifications
You must be signed in to change notification settings - Fork 762
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
Support user defined functions #3440
Comments
Yes, it is an easy task. We can register |
Let's make it more common way.
|
We still need to implement the I was thinking to add something like the following that you don't have to implement the function:
Also we can provide a
|
Yes, Currently we are implementing built-in functions which can be used by all users. |
Some built-in functions that return |
I took a deeper look at the code. I agree with you that it's not a good idea to use alias for built-in functions, because built-in functions are very useful to optimise queries, for example, On the other hand, it would be a great feature that we allow users to create their own functions based on the built-in ones. Do you know how to create a database that can only be accessed by specified users? |
I think you mean |
Yes, I plan to add it. We need a table to store all the The statement can be:
|
But Refer: https://clickhouse.com/docs/zh/sql-reference/statements/create/function/ |
We need support lambda expression at first... |
Thanks for pointing out, I haven't checked the ClickHouse one. Correct me if I'm wrong, the only difference I see between lambda & my proposal is how we specify the params, explicit or implicit. I think the implicit one might be much more friendly for the parser. |
You can take a try, it's valuable. |
Then back to the question, is there any table/database that can only be accessed by specified users? |
No, there is not. |
Do you think we can put it in |
It's better to store
|
Well that's a new concept for me. Can you share any documents about it? |
Summary
Currently we need to write different implementation for invertible functions, for example,
isnull
&isnotnull
. Can we create kind of function alias to avoid that? Forisnotnull
, we can haveisnotnull = not(isnull($1))
, when we parse the expressionisnotnull
, it can be rewrited asnot(isnull($1))
.The text was updated successfully, but these errors were encountered: