apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.52k stars 3.71k forks source link

use big endian for compressed complex column values to fit ObjectStrategy expectations #17422

Closed clintropolis closed 3 weeks ago

clintropolis commented 4 weeks ago

Description

Less ambitious fix than #17391, which adds the concept of value byte ordering to ObjectStrategy, this PR instead just hard-codes CompressedComplexColumn to use big endian value buffers in order to fix an issue related to value endianness with some ObjectStrategy implementations when used with the compression added in #16863.

I would still like to do the changes in the other PR at some point because it is a path to allowing all the stuff in segments to use native endian, but there are a lot of additional changes which need to be done first, such as squaring up the things that use ByteBufferWriter/ ObjectStrategy.fromByteBufferWithSize to determine if the header (size) int value endian should match the endian of the object strategy or not, and determining a more elegant way to handle this stuff.

Release note

Fixes an issue related to value buffers being ordered with the incorrect endianness which can cause some complex types, such as approxHistogram to incorrectly be read, and can lead to out of memory exceptions in some cases.


This PR has: