weighted_sum UDAF takes a weight, type, and type-weight mapping to produce an aggregated weight. For example, consider the following SQL snippet:
weighted_sum function produces a final weight_d of 12.0 (21.0 + 110.0). The UDAF is passed rows grouped by query, doc_id, and filters.
| query | type | doc_id | filters | typed_weight_d | 
|---|---|---|---|---|
| iPad | click | 1 | gear | 2 | 
| iPad | cart | 1 | gear | 1 |