This example shows how to write an aggregate UDF that takes a distinct UDT argument and returns a distinct UDT argument. The predefined type on which the distinct UDT is based is VARCHAR(20000) and the UDF performs a concatenation on the aggregation group.