This example shows the Java code for a simple aggregate UDF that calculates the standard deviation, as follows:
The Java class defines two methods that calculate the standard deviation. One method shows how to represent intermediate aggregate results as a byte array and the other method shows how to represent intermediate aggregate results as an object.