Kirill Tkalenko created IGNITE-28924:
----------------------------------------
Summary: SQL Calcite: Add the ability to implement a custom
DistinctAccumulator
Key: IGNITE-28924
URL: https://issues.apache.org/jira/browse/IGNITE-28924
Project: Ignite
Issue Type: Improvement
Reporter: Kirill Tkalenko
Assignee: Kirill Tkalenko
Currently, we can add our own
`org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.Accumulator`
via a
`org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorFactoryProvider`.
However, for `DISTINCT` operations, we cannot define a custom accumulator that
independently tracks unique values.
For example, if we were to implement an aggregate function like
"AVG_WITH_KEEP(DISTINCT salary, 'FIRST') WITHIN GROUP (ORDER BY
COALESCE(priority, 99) ASC, sale DESC)", we would need to get a unique value
based on the group rather than the column; to achieve this, we would need to
define our own `DistinctAccumulator`.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)