We should support fixed-size intermediate types for aggregate functions that can contain arbitrary structures. Currently these have to be allocated and stored in variable-length string values. E.g. average functions store their intermediate results in a 16-byte struct.
There is some skeleton code for a BufferVal type in the UDF tests but we don't have end-to-end support for this.