Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User Defined Functions in Presto

Tags:

presto

I am currently working with Presto 0.80. I have to write a user defined function to convert degree celsius to degree fahrenheit during select query. I did the same using Hive QL but was wondering if we can replicate the same in Facebook Presto.

Any help would be highly appreciated.

Thanks!!

like image 935
user3339340 Avatar asked May 27 '15 03:05

user3339340


1 Answers

Here is a guide for writing a new function in presto. https://trino.io/docs/current/develop/functions.html

After writing your function, add the plugin to the plugin directory as explained in SPI Overview.

There is another example for writing presto UDF from Qubole blog. http://www.qubole.com/blog/product/plugging-in-presto-udfs/ You can try it if you can make it work.

like image 139
袁安峰 Avatar answered Sep 19 '22 14:09

袁安峰