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.
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
Or you use Jython: http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html