COOL-cohort / COOL

the source code of the COOL system
https://www.comp.nus.edu.sg/~dbsystem/cool/
Apache License 2.0
44 stars 15 forks source link

Bug: float compression/decompression #130

Closed hugy718 closed 1 year ago

hugy718 commented 1 year ago

Description

The current float compression with large diff. The reason is that the xor to represent the difference will span all 32 bits. When xor is directly casted to long type, the first bit recoganized as the sign bit will be mapped to the sign bits in long which now is a 64 bit value. That would result in diffSize being 64, while it should have been 32.

Solution

The solution is to use Integer.toUsignedLong to covert int to long. Note that the casting in the other direction is ok: casting a value from long to int will take the last 32 bit as bits for the int.

hugy718 commented 1 year ago

@liuchangshiye has verified that PR #131 fixed the problem.