User-Defined Single-Row Functions Types of User-Defined Functions

13-4 Oracle Complex Event Processing CQL Language Reference and must be uniquely identifiable by its name that is, the method cannot have been overridden. For more information, see wlevs:function in the Oracle Complex Event Processing Developers Guide for Eclipse. 3. Invoke your user-defined function in the select list of a SELECT statement or the condition of a WHERE clause as Example 13–3 shows. Example 13–3 Accessing a User-Defined Single-Row Function in Oracle CQL ... view id=v1 schema=c1 c2 c3 c4[CDATA[ select mymodc1, 100, c2, c3, c4 from S1 ]]view ... query id=q1[CDATA[ select from v1 [partition by c1 rows 1] where c4 - c3 = 2.3 ]]query ...

13.2.2 How to Implement a User-Defined Aggregate Function

You implement a user-defined aggregate function by implementing a Java class that implements the com.bea.wlevs.processor.AggregationFunctionFactory interface. To implement a user-defined aggregate function: 1. Implement a Java class as Example 13–4 shows. Consider implementing your aggregate function so that it performs incremental processing, if possible. This will improve scalability and performance because the cost of recomputation on arrival of new events will be proportional to the number of new events as opposed to the total number of events seen thus far. The user-defined aggregate function in Example 13–4 supports incremental processing. Ensure that the data type of the return value corresponds to a supported data type as Section 13.1.2, User-Defined Function Datatypes describes. For more information on accessing the Oracle CEP cache from a user-defined function, see Section 13.1.3, User-Defined Functions and the Oracle CEP Server Cache . Example 13–4 Variance.java User-Defined Aggregate Function package com.bea.wlevs.test.functions; import com.bea.wlevs.processor.AggregationFunction; import com.bea.wlevs.processor.AggregationFunctionFactory; public class Variance implements AggregationFunctionFactory, AggregationFunction { private int count; private float sum; private float sumSquare; public Class?[] getArgumentTypes { return new Class?[] {Integer.class}; }