I have some User-Defined Aggregate Functions that use more than 6 parameters. They worked well in version 429.
However, half a year ago, after I upgraded Trino to version 433, these functions threw an exception: org.objectweb.asm.MethodTooLargeException: Method too large
Recently, I wanted to upgrade Trino to version 449 to experience some new features, but I found that this problem still exists.
I conducted tests with the aggregate function example from the official documentation under different numbers of parameters and found that exceeding 6 parameters would trigger the exception.
I have some User-Defined Aggregate Functions that use more than 6 parameters. They worked well in version 429.
However, half a year ago, after I upgraded Trino to version 433, these functions threw an exception:
org.objectweb.asm.MethodTooLargeException: Method too large
Recently, I wanted to upgrade Trino to version 449 to experience some new features, but I found that this problem still exists.
I conducted tests with the aggregate function example from the official documentation under different numbers of parameters and found that exceeding 6 parameters would trigger the exception.
The problem may occur in the: https://github.com/trinodb/trino/blob/3c40b19eaccb5dd1da69c6d2ca04e844d7329539/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationLoopBuilder.java#L87 As this method fills the ClassDefinition and CallSiteBinder objects with too many methods.
I have counted the number of methods filled in the ClassDefinition object by aggregate functions with different numbers of parameters:
$$ a_{n+1}=3a_n-4 $$
Apologize for my inability to further investigate this issue at my level of expertise. Is this a bug, or is it intended by design? @dain