Creating java UDF for Spark SQL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:44 AM
Hello,
I have created a sample java UDF which masks few characters of a string. However I facing couple of issues when uploading and using it.
First I could only import it, which for now is OK. But when do the following,
create function udf_mask as 'baffleCrypto' using jar '/Workspace/Users/sumandra@baffle.io/baffle-databricks-udf-1.0-SNAPSHOT.jar'
Throws an error
[NOT_SUPPORTED_WITH_DB_SQL] CREATE FUNCTION is not supported on a SQL warehouse.
Throws an error
[NOT_SUPPORTED_WITH_DB_SQL] CREATE FUNCTION is not supported on a SQL warehouse.
Is there an example on how to load a jar and then use it as external function. I followed the this guide
https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-function.html
https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-function.html
Even cut-n-paste errors out.
Any ideas?