Skip to main content

CREATE FUNCTION

Introduced or updated: v1.2.339

Creates a user-defined function.

Syntax

CREATE [ OR REPLACE ] FUNCTION [ IF NOT EXISTS ] <function_name> 
AS ( <input_param_names> ) -> <lambda_expression>
[ DESC='<description>' ]

Access control requirements

PrivilegeObject TypeDescription
SUPERGlobal, TableOperates a UDF

To create a user-defined function, the user performing the operation or the current_role must have the SUPER privilege.

Examples

See Usage Examples.

Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today