Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

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

New Contributor

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

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

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

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

New Contributor

Thank you @Harald Berghoff I will surely check that.

Highlighted

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

Contributor