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

   ### Description
   
   Currently 'auto' typed columns write out the compressed int column that 
holds the dictionary ids and builds the bitmap indexes during the `serialize` 
method of the various serializer implementations. This isn't really very chill 
though, and can cause heap footprints to explode for columns with high value 
cardinality, mainly due to the `MutableBitmap` being built on the fly. This PR 
switches these serializers to be more like the nested column serializers they 
originally came from (`GlobalDictionaryEncodedFieldColumnWriter`). These 
serializers now write out an uncompressed int column with the sorted dictionary 
ids to temp, and then iterate over this intermediate value column in the 
`writeTo` method to build the final compressed int column and any bitmap 
indexes. This shifts the heap being occupied with the `MutableBitmap` of only a 
single auto column at a time and only while `writeTo` is being called, trading 
a bit extra time in exchange for a much more predictable heap load.
   
   In the future I would like to add a new compressed column and writer 
implementation that is easier to iterate over, or maybe just make it easy to 
just iterate over the current generic indexed based solution we have for 
writing compressed columns (though I would sort of like to replace using 
generic indexed for compression so I'd perhaps be more into doing the former). 
With either improvement, we could keep writing out the compressed column 
directly during `serialize`, and then iterate over the compressed column in 
`writeTo` to build the indexes.
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] 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.
   - [ ] 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