Snowflake introduces ACCUMULATE, a way to build custom aggregate functions entirely in SQL without external code. It uses four lambda steps—initialize, accumulate, combine, and terminate—to define how the aggregation works. You can create aggregates like PRODUCT or geometric mean directly in #SQL. This eliminates the need for Python, JavaScript, or other languages and makes complex aggregations flexible and scalable.
http://quettabyte.net/gist.php?id=jnvj9