liaoxin01 commented on code in PR #16832:
URL: https://github.com/apache/doris/pull/16832#discussion_r1109268659


##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -389,6 +388,22 @@ std::string SegmentWriter::_full_encode_keys(
     return encoded_keys;
 }
 
+void SegmentWriter::_encode_seq_column(const 
vectorized::IOlapColumnDataAccessor* seq_column,
+                                       size_t pos, string* encoded_keys) {
+    auto field = seq_column->get_data_at(pos);
+    // To facilitate the use of the primary key index, encode the seq column
+    // to the minimum value of the corresponding length when the seq column
+    // is null
+    if (UNLIKELY(!field)) {
+        encoded_keys->push_back(KEY_NULL_FIRST_MARKER);
+        size_t seq_col_length = 
_tablet_schema->column(_tablet_schema->sequence_col_idx()).length();
+        encoded_keys->append(seq_col_length, KEY_MINIMAL_MARKER);
+        return;
+    }
+    encoded_keys->push_back(KEY_NORMAL_MARKER);

Review Comment:
   check encoded_keys? encoded_keys is an output parameter, the caller will 
ensure the validity.
   
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to