[NUCCORE-1181] Detect invalid result aggregate clause during (generic)
compilation