squash icon indicating copy to clipboard operation
squash copied to clipboard

General Function Aggregates

Open codesplode opened this issue 5 years ago • 0 comments

Description

This feature intends to generalize the creation of common FunctionExpression implementations within dialects. It introduces a GeneralFunctionExpression class for functions that simply need a name and one value, which could be used by any dialects to quickly add functions, particularly aggregates.

As such, this pull request also includes the average() function as an addition to the BaseSQLDialect

Testing

Unit tests were added for the base aggregate functions, however, some adjustment was required to make it work generically for all databases as the types returned by the databases for an aggregate are not all the same. Some returned a Long vs a Double for the average() function for example.

codesplode avatar May 20 '19 18:05 codesplode