Skip to main content
Creates a user defined function (UDF) from a lambda expression. The expression must consist of function parameters, constants, operators, or other function calls. Syntax
A function can have an arbitrary number of parameters. There are a few restrictions:
  • The name of a function must be unique among user defined and system functions.
  • Recursive functions are not allowed.
  • All variables used by a function must be specified in its parameter list.
If any restriction is violated then an exception is raised. Example
Query
Response
A conditional function is called in a user defined function in the following query:
Query
Response
Replace an existing UDF:
Query
Response

Executable UDFs.

User-defined functions in ClickHouse Cloud

Last modified on June 19, 2026