v.19.3Improvements
Added Support for Scalar Subqueries with Aggregate Function State Result
Added support for scalar subqueries with aggregate function state result. #4348 (Nikolai Kochetov)
Why it matters
This feature enables users to use aggregate function states within scalar subqueries, allowing more advanced aggregation computations and more efficient query patterns by reusing intermediate aggregate states.How to use it
Users can write scalar subqueries that return aggregate function state values and utilize these states in outer queries. For example, you can use aggregate function states likesumState in a scalar subquery and then apply sumMerge on the result.