Snowflake functions overloading
![Snowflake functions overloading](https://media.dwh.dev/blog/posts/functions-overloading.1.jpg)
Snowflake support procedures and functions overloading. You can create multiple UDFs with the same name but with different types of arguments.
All data lineage tools I've seen don't care about UDFs, let alone show the data flows that go through them.
But dwh.dev is NextGen Data Lineage, so it's different: we parse all UDFs and show lineage passing through them if they are written in SQL. By the way, such functions are MASKING and ROW ACCESS POLICY, which nobody shows in lineage except dwh.dev.
Let's create overloaded UDFs:
CREATE TABLE A(ID INT);
CREATE TABLE B(S STRING);
CREATE OR REPLACE FUNCTION fn_override ( _id number )
RETURNS TABLE (id int)
AS 'select id from a where id > _id'
;
CREATE OR REPLACE FUNCTION fn_override ( _s string )
RETURNS TABLE (s string)
AS 'select s from b where s != _s'
;
The first one has Table A as a source, and the second one Table B.
Now let's create VIEWs depending on these functions:
CREATE VIEW V1 AS
SELECT * FROM TABLE(fn_override(1));
CREATE VIEW V2 AS
SELECT * FROM TABLE(fn_override('1'));
Here is the Dwh.dev result: