Apache Hive UDF functions in Go

Alexandr Korsak
1 min readApr 3, 2017

Lets assume you are Go developer and you want to bring some awesomeness in Java world you can definitely do it :) In Apache Hive it’s possible to write custom functions to run it as part of the query. It’s a basic java project and it could be done by maven build tool. Below I placed example of go project and how to wrap go lib inside of jar file(using github.com/sridharv/gojava) and use FFI to make it callable from java application.

make build && make release should make .jar file and then you can attach it to the maven project.

Now you can access the library from java project and call go function wrapped by FFI methods. Don’t forget to build your native library on platform that you are going to use as deployment. In my case Apache Hive is working in CentOS that’s why I wrapped libparam.jar build by docker container to prepare for deployment in linux environment.

--

--