User-Defined Functions
User-defined functions extend the SQL computation capabilities of Lakehouse. Two types are supported: SQL Function (executed within the engine) and External Function (calls an external service).
For a detailed introduction, see Function Object Model.
In This Chapter
SQL Function
External Function
Common Operations
-- Create a SQL scalar function
CREATE FUNCTION public.area(x DOUBLE, y DOUBLE)
RETURNS DOUBLE
RETURN x * y;
-- Use the function
SELECT public.area(3, 4); -- Output: 12.0
-- List all functions
SHOW FUNCTIONS;
-- Drop a function
DROP FUNCTION public.area;