Presto 中的用户定义函数 [英] User Defined Functions in Presto

查看:91
本文介绍了Presto 中的用户定义函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Presto 0.80.我必须编写一个用户定义的函数来在选择查询期间将摄氏度转换为华氏度.我使用 Hive QL 做了同样的事情,但想知道我们是否可以在 Facebook 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.

任何帮助将不胜感激.

谢谢!!

推荐答案

这是在 presto 中编写新函数的指南.https://trino.io/docs/current/develop/functions.html

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

编写函数后,将插件添加到 plugin 目录,如 SPI 概述.

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

Qubole 博客上还有一个写 presto UDF 的例子.http://www.qubole.com/blog/product/plugging-in-presto-udfs/如果你能成功,你可以试试.

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.

这篇关于Presto 中的用户定义函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆