SUM, AVG, MAX…) are natively converted to the remote database equivalent aggregations.
However, if you write some custom aggregation functions (UDAF) you will also need to define how this aggregation is done in your remote database.
Sum product example
This example is based on a ClickHouse database and SQL but can easily be ported to other databases. For instance let’s consider a simple sum product on scalar values, which in SQL would beSUM(quantity * price).
Here is a simple implementation with Copper: