Skip to content

General Function Aggregates#26

Open
codesplode wants to merge 8 commits intoorangy:masterfrom
codesplode:pr-feature-general-function-aggregates
Open

General Function Aggregates#26
codesplode wants to merge 8 commits intoorangy:masterfrom
codesplode:pr-feature-general-function-aggregates

Conversation

@codesplode
Copy link
Contributor

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.

Mike and others added 8 commits November 1, 2018 15:13
Update to get all tests working across JDK Versions
Update from origin project
min and max will match the type that are passed (numeric, date, etc.)

sum only applies to certain types, but could of course be a sum of integers or decimals, which makes maintaining a matching type a requirement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant