Class UserDefinedSqlAggregationFunction

java.lang.Object
com.activeviam.directquery.api.UserDefinedSqlAggregationFunction

public final class UserDefinedSqlAggregationFunction extends Object
User defined Sql aggregation function.

This must be the counterpart of a "core" Atoti aggregation, with the same key. This core aggregation can be either a IUserDefinedAggregateFunction or a IAggregationFunction.

Example for a Sum product aggregation.

UserDefinedSqlAggregationFunction.builder()
        .pluginKey("MY_SUM_PRODUCT")
        .inputsNumber(2)
        .sqlExpressionProviders(
            List.of(
                sqlColumnNames ->
                    "SUM(" + sqlColumnNames.get(0) + " * " + sqlColumnNames.get(1) + ")"))
        .outputTypes(List.of(StandardTypes.DOUBLE))
        .build();