Apache Presto Custom Function Application - Apache Presto

What is Apache Presto - Custom Function Application?

We need to create a Maven project in order to develop Presto custom function.

SimpleFunctionsFactory.java

Create SimpleFunctionsFactory class to implement FunctionFactory interface.

SimpleFunctionsPlugin.java

Create a SimpleFunctionsPlugin class to implement Plugin interface.

Add Resource File

We need to create a resource file which is specified in the implementation package.

Now move to the resource file location @ /path/to/resource/

Then add the changes,

pom.xml

Add the below dependencies to pom.xml file.

SimpleFunctions.java

We need to create SimpleFunctions class using Presto attributes.

After the application is created compile and execute the application. It will produce the JAR file. Copy the file and move the JAR file into the target Presto server plugin directory.

Compilation

Execution

Now restart Presto server and connect Presto client. Then execute the custom function application as explained below,

Query

Result

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Apache Presto Topics