You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/07/03 09:25:20 UTC
[GitHub] [incubator-doris] kangpinghuang edited a comment on issue #1390:
Support zone map for column
kangpinghuang edited a comment on issue #1390: Support zone map for column
URL: https://github.com/apache/incubator-doris/issues/1390#issuecomment-508015441
here is my design:
1. define ZoneMap with serialize and deserialize
class ZoneMap {
public:
serialize();
deserialize();
private:
std::string min_value;
std::string max_value;
// if the whole page is null
// if true, omit min_value and max_value
bool is_null_page;
};
2. add ComparableEncoder to encode the value as comparable binary
add a ComparableEncoder that can encode column value to comparable binary, and store them to ZoneMap.
And then we can use binary to compare min/max value with predicate value directyly. do not have to care about the field type when filter the page
3. define ZoneMapBuilder
class ZoneMapBuilder {
Status add(ZoneMap zone_map);
};
add should call zone_map's serialize api and BinaryPlainPageBuilder to store the serialized zone map value.
4. define ZoneMapDecoder
class ZoneMapDecoder {
Status load_zone_map(ColumnZoneMap* column_zone_map);
};
load_zone_map use BinaryPlainPageDecoder to get the serialized zone map and the call ZoneMap.deserialize the get ZoneMap and the ColumnZoneMap.add(zone_map) to construct column zone map.
5. define ColumnZoneMap
class ColumnZoneMap {
Status add(ZoneMap page_zone_map);
int compare_to_min(const std::string& value, int page_index);
int compare_to_max(const std::string& value, int page_index);
bool is_null_page(int page_index);
private:
int _page_size;
// min value array
std::string* _min_value;
// max value array
std::string* _max_value;
bool* _is_null_pages;
};
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org