[jOOQ/jOOQ#7539] Support FILTER () and OVER () with JSON_ARRAYAGG

This commit is contained in:
Lukas Eder 2024-05-02 14:35:55 +02:00
parent 76a16d6dd4
commit 10e7cc3ecd

View File

@ -79,6 +79,7 @@ import static org.jooq.impl.Tools.BooleanDataKey.DATA_FORCE_CASE_ELSE_NULL;
import java.util.Collection;
import java.util.Set;
import org.jooq.AggregateFilterStep;
import org.jooq.Context;
import org.jooq.DataType;
import org.jooq.Field;
@ -294,11 +295,11 @@ implements
);
}
static final Field<?> arrayAggEmulation(boolean distinct, Field<?> field, SortFieldList orderBy) {
return Tools.apply(
distinct ? arrayAggDistinct(field) : arrayAgg(field),
agg -> Tools.isEmpty(orderBy) ? agg : agg.orderBy(orderBy)
);
final Field<?> arrayAggEmulation(boolean d, Field<?> field, SortFieldList orderBy) {
return fo(Tools.apply(
d ? arrayAggDistinct(field) : arrayAgg(field),
agg -> (AggregateFilterStep<?>) (Tools.isEmpty(orderBy) ? agg : agg.orderBy(orderBy))
));
}