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

   ### Description
   This PR fixes a bug with `FrontCodedIndexed` when containing only a single 
null value. Because the null value is not actually stored in the "value 
buckets", it can result in a null pointer exception in 
`FrontCodedIndexedWriter` when serializing the column, and a buffer underflow 
in `FrontCodedIndexed` when creating an iterator on a `FrontCodedIndexed` with 
only a null value, since the values section is actually empty.
   
   I also added bounds checking to the `get` method of `FrontCodedIndexed` as a 
safety measure, which if everything is written correctly shouldn't be needed, 
but also doesn't seem to add much performance impact so it seems worth the 
sanity checks it provides in the event 
   ```
   Benchmark              (query)  (rowsPerSegment)  (storageType)  
(stringEncoding)  (vectorize)  Mode  Cnt      Score     Error  Units
   SqlBenchmark.querySql       23           5000000           mmap              
none        false  avgt    5  11256.550 ±  43.827  ms/op
   SqlBenchmark.querySql       23           5000000           mmap              
none        force  avgt    5  11255.502 ±  29.165  ms/op
   SqlBenchmark.querySql       23           5000000           mmap     
front-coded-4        false  avgt    5  11978.854 ±  27.574  ms/op
   SqlBenchmark.querySql       23           5000000           mmap     
front-coded-4        force  avgt    5  12724.125 ±  85.407  ms/op
   SqlBenchmark.querySql       23           5000000           mmap    
front-coded-16        false  avgt    5  13319.569 ±  41.002  ms/op
   SqlBenchmark.querySql       23           5000000           mmap    
front-coded-16        force  avgt    5  13300.229 ±  58.178  ms/op
   SqlBenchmark.querySql       26           5000000           mmap              
none        false  avgt    5     24.458 ±   0.771  ms/op
   SqlBenchmark.querySql       26           5000000           mmap              
none        force  avgt    5     20.168 ±   0.615  ms/op
   SqlBenchmark.querySql       26           5000000           mmap     
front-coded-4        false  avgt    5     24.781 ±   0.720  ms/op
   SqlBenchmark.querySql       26           5000000           mmap     
front-coded-4        force  avgt    5     20.343 ±   0.666  ms/op
   SqlBenchmark.querySql       26           5000000           mmap    
front-coded-16        false  avgt    5     24.626 ±   0.792  ms/op
   SqlBenchmark.querySql       26           5000000           mmap    
front-coded-16        force  avgt    5     20.578 ±   0.666  ms/op
   SqlBenchmark.querySql       27           5000000           mmap              
none        false  avgt    5    407.870 ±   4.176  ms/op
   SqlBenchmark.querySql       27           5000000           mmap              
none        force  avgt    5    245.788 ±   1.136  ms/op
   SqlBenchmark.querySql       27           5000000           mmap     
front-coded-4        false  avgt    5    416.001 ±   5.973  ms/op
   SqlBenchmark.querySql       27           5000000           mmap     
front-coded-4        force  avgt    5    248.944 ±   8.933  ms/op
   SqlBenchmark.querySql       27           5000000           mmap    
front-coded-16        false  avgt    5    419.480 ±   7.841  ms/op
   SqlBenchmark.querySql       27           5000000           mmap    
front-coded-16        force  avgt    5    256.627 ±   4.642  ms/op
   ```
   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 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.
   - [x] 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