From the course: Intro to Snowflake for Devs, Data Scientists, Data Engineers
Unlock this course with a free trial
Join today to access over 26,000 courses taught by industry experts.
User-defined functions (UDFs): Part 1 - Snowflake Tutorial
From the course: Intro to Snowflake for Devs, Data Scientists, Data Engineers
User-defined functions (UDFs): Part 1
- Snowflake has a ton of built-in functions. Think coalesce, date diff, count, et cetera. But sometimes you need a custom function for a very specific use case. Maybe you have some SQL code, you find yourself reusing a bunch, and it would be cleaner to just wrap it in a function. To make this easy, Snowflake lets you create user-defined functions, which I'll usually refer to by their acronym, UDFs. When I first learned about UDFs, I was a little intimidated by them, and I'm not 100% sure why. I think it's because they seemed fancy or complicated or something. I don't really know. But I've come to understand that UDFs can be quite simple, and I hope you feel that way as well by the end of this video. Before we create and use our own UDFs, let's run through a couple of examples of Snowflake's preexisting functions, so its non-user defined functions. Let's start with ABS, which lets you take the absolute value of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.