Spark-Scala: Overcoming UDF Limitations with More Than 22 Parameters
Briefly

The underlying cause of this issue is quite straightforward. Scala incorporates a concept called ETA Expansion, which can convert methods into functions, enabling the use of higher-order functions. However, since this conversion process occurs implicitly and only supports Functional Types from Function0 to Function22, attempting to implicitly convert a method with over 22 parameters will result in the aforementioned error.
Instead of employing a method with over 22 parameters, consider designing a method with just one parameter of type Row. This approach allows you to pass any number of columns or parameters encapsulated within a Row object.
In this approach, you can encapsulate any number of columns within a struct and then pass it to the UDF.
Read at Medium
[
add
]
[
|
|
]