How to use language property in Snowflake UDFs
How to use language property in Snowflake UDFs
User Defined Functions in Snowflake Video
You can watch the complete hands on video tutorial
Step-2: SQL Construct
-- lets change the context
use role sysadmin;
use database ttips;
use schema udfs;
-- creating a simple SQL udf
create or replace secure function simple_sql_udf()
returns string
language SQL
comment = 'This is simple sql language udf'
as
$$
select 'simple sql language udf'
$$;
-- creating a simple javascript udf
create or replace secure function simple_js_udf()
returns string
language javascript
comment = 'This is simple JavaScript language udf'
as
$$
return 'simple javascript language udf'
$$;
-- just example, we will cover later in this video
create function my_java_udf()
returns double
language java
imports = ('@~/java-udf/MyUDF.jar')
handler = 'MyJavaUDF.myHandler';
-- see the function output
select simple_sql_udf(),simple_js_udf();
-- lets see them and validate the columns
-- and how the language is captured.
show functions like 'SIMPLE%';
-- lets describe the
desc function simple_sql_udf();
desc function simple_js_udf();
All SQL Scripts - Part 01 to Part 09
- Part-02 User Defined Function in Snowflake SQLs
- Part-02 JavaScript & SQL User Defined Function in Snowflake SQLs
- Part-03 Strict Property User Defined Function in Snowflake SQLs
- Part-04 Not Null Return User Defined Function in Snowflake SQLs
- Part-05 Secure User Defined Function in Snowflake SQLs
- Part-06 Inbuilt Vs. User Defined Function in Snowflake SQLs
- Part-07 Table User Defined Function in Snowflake SQLs
- Part-08 Method Overloading SQL Script
- Part-09 Java User Defined Function SQL & Java Code