You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhannngchen (via GitHub)" <gi...@apache.org> on 2023/02/17 07:24:16 UTC

[GitHub] [doris] zhannngchen commented on a diff in pull request #16832: [fix](merge-on-write) fix that be may coredump when sequence column is null

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


##########
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);

Review Comment:
   if the sequence columns is type of INT, is it work well if user set negative values?



-- 
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-unsubscribe@doris.apache.org

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


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