Apama 10.15.0 | Developing Apama Applications | Developing Apama Applications in EPL | Working with Streams and Stream Queries | Defining custom aggregate functions | Overloading in custom aggregate functions
 
Overloading in custom aggregate functions
As with event types, the names of custom aggregate functions must be unique. Unlike the built-in aggregate functions, there is no overloading, so it is not possible to declare two aggregate functions with the same name and different parameters or two aggregate functions with different bounded and unbounded specifiers and the same name. For example:
aggregate unbounded max( float value) returns float {...}
aggregate bounded max( float value) returns float {...}
   // Error! You cannot use the same function name.
 
aggregate unbounded maxu( float value) returns float {...}
aggregate bounded maxb( float value) returns float {...}
   // Both of these queries are correct. They have different names.
In contrast, the built-in bounded and unbounded aggregate functions are overloaded.