Support bitmap index build (#2050)

This PR implements the build part of bitmap index support. It follows most of the design described in #1684 , but with the following differences and enhancements

1. Bitmap indexes are now written in the segment file for simplicity. Separate index file would be helpful when we're going to support `alter table add bitmap index` in the future though.
2. We switch to a generalized index page format for all data types rather than specialize for each one. Code simplicity and reusability is preferred here than optimal compression rate.
3. We introduce a new abstraction called `IndexedColumn` to unify the processing of the dictionary section and bitmap section of bitmap index. IndexedColumn is a column with an optional ordinal index and an optional value index. Ordinal index enables us to seek to a particular rowid within the column. Value index requires IndexedColumn to store ordered values and enables us to seek to a particular value. Therefore, the dictionary section can be represented by an IndexedColumn with value index and the bitmap section can be represented by an IndexedColumn with ordinal index.
This commit is contained in:
Dayue Gao
2019-11-20 13:51:21 +08:00
committed by ZHAO Chun
parent aedccc4ec4
commit d72fbdf425
28 changed files with 1327 additions and 60 deletions

View File

@ -22,9 +22,10 @@
namespace doris {
template<typename TraitsType>
KeyCoder::KeyCoder(TraitsType traits)
: _encode_ascending(traits.encode_ascending),
_decode_ascending(traits.decode_ascending) {
KeyCoder::KeyCoder(TraitsType traits)
: _full_encode_ascending(traits.full_encode_ascending),
_encode_ascending(traits.encode_ascending),
_decode_ascending(traits.decode_ascending) {
}
struct EnumClassHash {