- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:59 AM
Is it possible to pass a parameter to a SQL UDF to another SQL UDF that is called by the first SQL UDF?
Below is an example where I would like to call tbl_filter() from tbl_func() by passing the tbl_func.a_val parameter to tbl_filter().
Obviously, I could just implement the logic in one function, but in my use case that means repeating the "tbl_filter()" part of the query over and over in different versions of "tbl_func()", which defeats the purpose of packaging code in functions. Ideally, there would be a single version of "tbl_filter()" to maintain that could be called from a variety of different versions of "tbl_func()".
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 08:12 AM
Thanks, Kaniz, that does not suit my use case, but I got an answer to this on StackOverflow:
In Databricks Workbook using Spark SQL, how to pass parameters thru SQL UDF functions? - Stack Overf...
The issue was the use of temporary functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 08:12 AM
Thanks, Kaniz, that does not suit my use case, but I got an answer to this on StackOverflow:
In Databricks Workbook using Spark SQL, how to pass parameters thru SQL UDF functions? - Stack Overf...
The issue was the use of temporary functions.

