Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

how to write user define aggregate function for hdf streaming analytics manager?

I am having 4 Nodes HDP cluster with 3 nodes HDF cluster. I am having streaming analytics manager (SAM) installed. I want to create UDAF (User Defined Aggregate Function), I am confused how to write UDAF code? Which programming language should I use for creating jar file for UDAF. I am familiar with Python, Scala, R. Please suggest some links to refer.

3 REPLIES 3

Super Collaborator

I think you need to write it in Java, see this article: https://community.hortonworks.com/articles/145803/extending-sam-with-custom-processors-user-defined....

I am not very familiar with Scala, but you should be able to create an object in Scala that can be imported in Java. Here is some example code https://lampwww.epfl.ch/~michelou/scala/using-scala-from-java.html

Also you can write a wrapper in Java that executes Python code: https://pythonhosted.org/javabridge/java2python.html

http://jpy.readthedocs.io/en/latest/intro.html

Or you use Jython: http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html

Thank you @Harald Berghoff I will surely check that.

Contributor
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.