rash67 opened a new pull request, #13141:
URL: https://github.com/apache/druid/pull/13141

   ### Description
   
   This adds min/max functions for CompressedBigDecimal. It exposes these
   functions via sql (BIG_MAX, BIG_MIN--see the SqlAggFunction
   implementations).
   
   It also includes various bug fixes and cleanup to the original
   CompressedBigDecimal code include the AggregatorFactories. Various null
   handling was improved.
   
   Additional test cases were added for both new and existing code
   including a base test case for AggregationFactories. Other tests common
   across sum,min,max may be refactored also to share the varoius cases in
   the future.
   
   It's largely copy-and-paste of the original sum classes into min/max with 
logic changes.
   The major changes are in the *CompressedBigDecimal classes to do min/max, 
setValue(), and
   initialize to max/min to do min/max calcluations.
   
   #### Fixed the bug ...
   -fix null handling in finalizeComputation()
   -min/max has proper null handling (not really a bug so much as required for 
handling agg of all nulls vs sum can return a 0)
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `CompressedBigDecimaSumAggregatorFactory`
    * `CompressedBigDecimalMaxAggregatorFactory`
    * `CompressedBigDecimalMinAggregatorFactory`
    * `CompressedBigDecimal`
    * `ArrayCompressedBigDecimal`
    * `ByteBufferCompressedBigDecimal`
   <hr>
   
   ## Future Code Improvements
    * the three SqlAggregators are virtually identical. The SqlAggFunctions are 
except for the NAME. The SqlAggregators  could be condensed into a base class 
that is parameterized on which factory to create and the NAME (possibly will do 
before commit, but I want this up and review started)
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not 
all of these items apply to every PR. Remove the items which are not done or 
not relevant to the PR. None of the items from the checklist below are strictly 
necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   - [ X] been self-reviewed.
   - [ X] added documentation for new or modified features or behaviors.
   - [X ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ X] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ X] 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]

Reply via email to