wangbo commented on a change in pull request #1816: v2 segment support string 
encode(#1766)
URL: https://github.com/apache/incubator-doris/pull/1816#discussion_r329334107
 
 

 ##########
 File path: be/src/olap/rowset/segment_v2/column_zone_map.cpp
 ##########
 @@ -79,10 +87,17 @@ Status ColumnZoneMapBuilder::flush() {
 
 void ColumnZoneMapBuilder::_reset_zone_map() {
     // we should allocate max varchar length and set to max for min value
-    Slice *min_slice = (Slice *)_zone_map.min_value;
-    min_slice->data = _max_string_value;
-    min_slice->size = OLAP_STRING_MAX_LENGTH;
-    _field->set_to_max(_zone_map.min_value);
+    if (_type_info->type() == OLAP_FIELD_TYPE_VARCHAR) {
+        Slice *min_slice = (Slice *)_zone_map.min_value;
+        min_slice->data = _max_varchar_value;
+        min_slice->size = OLAP_STRING_MAX_LENGTH;
+    } else if (_type_info->type() == OLAP_FIELD_TYPE_CHAR) {
+        Slice *min_value = (Slice *)_zone_map.min_value;
+        min_value->data = _max_char_value;
+        min_value->size = OLAP_CHAR_MAX_LENGTH;
 
 Review comment:
   Fe defines max char and varchar length,see ScalarType;this is a temporary 
define,later I will use columns real length

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to