tijoparacka opened a new pull request, #13704: URL: https://github.com/apache/druid/pull/13704
As of now, the only supported arithmetic functions are +, -, *, /, and quotient. https://druid.apache.org/docs/latest/querying/post-aggregations.html#arithmetic-post-aggregator. The request is to add an additional function to support square, cube , squre root..etc. This can be achieved by adding the power of function equivalent to Math.pow() The proposal is to add a pow function that enables all the about use case. Square of a number can be represent by pow(f1,2) , Cube can be represented as power(f1 ,3) , Square root of a number can be represented by power(f1,0.5) , Fixes #13703 ### Description The request is to add an additional function to support square, cube , squre root..etc. Describe your patch: Modified the class processing/src/main/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregator.java and added UT :processing/src/test/java/org/apache/druid/query/aggregation/post/ArithmeticPostAggregatorTest.java Added Enum POW with compute function invoking Math.pow function. This PR has: - [x] been self-reviewed. - [ ] added documentation for new or modified features or behaviors. - [ ] a release note entry in the PR description. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md) - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] added integration tests. - [ ] been tested in a test Druid cluster. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
