wangbo commented on a change in pull request #1944: Segment v2 use string's 
real length(#1943)
URL: https://github.com/apache/incubator-doris/pull/1944#discussion_r334217064
 
 

 ##########
 File path: be/src/olap/field.h
 ##########
 @@ -55,9 +55,11 @@ class Field {
     inline size_t field_size() const { return size() + 1; }
     inline size_t index_size() const { return _index_size; }
 
-    inline void set_to_max(char* buf) const { return 
_type_info->set_to_max(buf); }
+    virtual inline void set_to_max(char* buf) const { return 
_type_info->set_to_max(buf); }
+    //todo delete this method when segment v2 release
+    inline void set_to_max_v1(char* buf) const { return 
_type_info->set_to_max(buf); }
 
 Review comment:
   > why the length of memset is gt than the char array's real length?
   
   For Varchar field,use set_to_max instead of set_to_max_v1 means using 
Field._length to set slice.size. For segment v1, Field._length=slice.size + 
sizeof(StringLengthType)(see WrapperField.create), Field._length > slice.size
   when calling set_to_max in segment v1 code,Field._length will be used to 
memset slice.size,so memset's length will gt than slice.size.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to