seawinde commented on code in PR #65076:
URL: https://github.com/apache/doris/pull/65076#discussion_r3548756382


##########
be/src/storage/segment/row_binlog_segment_writer.cpp:
##########
@@ -430,48 +438,76 @@ Status 
RowBinlogSegmentWriter::_fill_before_columns(size_t num_rows) {
 
 Status RowBinlogSourceDataWriter::init() {
     _olap_data_convertor = std::make_unique<OlapBlockDataConvertor>();
-    // _normal_column_ids: the columns which we need to write into binlog from 
source block
     if (UNLIKELY(_opt.source.tablet_schema == nullptr)) {
         return Status::InternalError("row binlog writer missing 
source_tablet_schema");
     }
-    for (uint32_t i = 0; i < _opt.source.tablet_schema->num_visible_columns(); 
i++) {
-        _normal_column_ids.emplace_back(i);
+
+    const auto& source_schema = _opt.source.tablet_schema;
+    // Row-binlog normal columns are a source-schema prefix: visible columns 
plus hidden key columns.
+    // Hidden non-key columns are only allowed after this prefix and are not 
written to row-binlog.
+    _normal_column_count = 0;
+    bool seen_hidden_non_key_column = false;
+    for (uint32_t cid = 0; cid < source_schema->num_columns(); ++cid) {
+        const auto& column = source_schema->column(cid);
+        if (!column.visible() && !column.is_key()) {

Review Comment:
   have fixed



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

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to