This example shows the Java code for a simple aggregate UDF that calculates the arithmetic sum for a group.