This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 7c30cb20fd132d73e588a6435319cd750ee82c64
Author: abmdocrt <yukang.lian2...@gmail.com>
AuthorDate: Tue Mar 5 11:39:04 2024 +0800

    [Fix](partial update) Fix partial update load false when schema includes 
auto increment column (#31725)
    
    Problem:
    When partially updating columns without specifying the auto-increment 
column, and the imported data contains new keys, an error stating the 
auto-increment column could not be found occurs.
    
    Reason:
    The logic for partial column updates does not account for new keys in 
auto-increment columns. Since auto-increment columns can be generated by the 
system, it's possible to omit this column data during import. However, partial 
column updates treat this as a regular column, expecting it to be nullable or 
have a default value for automatic filling, overlooking the fact that 
auto-increment columns can also be auto-filled. This oversight leads to the 
error.
    
    Solution:
    Incorporate a check for auto-increment columns into the partial column 
update logic, and include the logic for generating auto-increment column values 
in the process of completing partial updates.
---
 be/src/exec/tablet_info.cpp                        |  7 ++
 be/src/exec/tablet_info.h                          |  2 +
 be/src/olap/delta_writer_v2.cpp                    |  6 +-
 be/src/olap/partial_update_info.h                  |  3 +-
 be/src/olap/rowset/segment_v2/segment_writer.cpp   | 28 ++++++-
 be/src/olap/rowset/segment_v2/segment_writer.h     |  4 +-
 .../rowset/segment_v2/vertical_segment_writer.cpp  | 27 ++++++-
 .../rowset/segment_v2/vertical_segment_writer.h    |  3 +
 be/src/olap/rowset_builder.cpp                     |  4 +
 be/src/olap/tablet_meta.cpp                        |  1 +
 be/src/olap/tablet_schema.cpp                      |  1 +
 be/src/olap/tablet_schema.h                        | 11 +++
 .../org/apache/doris/planner/OlapTableSink.java    |  5 ++
 gensrc/proto/descriptors.proto                     |  1 +
 gensrc/proto/olap_file.proto                       |  1 +
 gensrc/thrift/Descriptors.thrift                   |  3 +-
 .../unique/auto_inc_partial_update3.csv            |  5 ++
 .../unique/test_unique_table_auto_inc.out          | 16 ++++
 .../fault_injection_p0/concurrency_update2.csv     |  5 ++
 .../fault_injection_p0/concurrency_update3.csv     |  5 ++
 ..._partial_update_publish_conflict_with_error.out | 93 ++++++++++++----------
 .../unique/test_unique_table_auto_inc.groovy       | 15 +++-
 ...rtial_update_publish_conflict_with_error.groovy |  4 +-
 23 files changed, 200 insertions(+), 50 deletions(-)

diff --git a/be/src/exec/tablet_info.cpp b/be/src/exec/tablet_info.cpp
index 582a97bd681..e14ec71a90b 100644
--- a/be/src/exec/tablet_info.cpp
+++ b/be/src/exec/tablet_info.cpp
@@ -127,6 +127,9 @@ Status OlapTableSchemaParam::init(const 
POlapTableSchemaParam& pschema) {
     _version = pschema.version();
     _is_partial_update = pschema.partial_update();
     _is_strict_mode = pschema.is_strict_mode();
+    if (_is_partial_update) {
+        _auto_increment_column = pschema.auto_increment_column();
+    }
 
     for (auto& col : pschema.partial_update_input_columns()) {
         _partial_update_input_columns.insert(col);
@@ -187,6 +190,9 @@ Status OlapTableSchemaParam::init(const 
TOlapTableSchemaParam& tschema) {
     if (tschema.__isset.is_strict_mode) {
         _is_strict_mode = tschema.is_strict_mode;
     }
+    if (_is_partial_update) {
+        _auto_increment_column = tschema.auto_increment_column;
+    }
 
     for (auto& tcolumn : tschema.partial_update_input_columns) {
         _partial_update_input_columns.insert(tcolumn);
@@ -257,6 +263,7 @@ void 
OlapTableSchemaParam::to_protobuf(POlapTableSchemaParam* pschema) const {
     pschema->set_version(_version);
     pschema->set_partial_update(_is_partial_update);
     pschema->set_is_strict_mode(_is_strict_mode);
+    pschema->set_auto_increment_column(_auto_increment_column);
     for (auto col : _partial_update_input_columns) {
         *pschema->add_partial_update_input_columns() = col;
     }
diff --git a/be/src/exec/tablet_info.h b/be/src/exec/tablet_info.h
index 7e4a764d6a1..a157b579487 100644
--- a/be/src/exec/tablet_info.h
+++ b/be/src/exec/tablet_info.h
@@ -92,6 +92,7 @@ public:
     std::set<std::string> partial_update_input_columns() const {
         return _partial_update_input_columns;
     }
+    std::string auto_increment_coulumn() const { return 
_auto_increment_column; }
     bool is_strict_mode() const { return _is_strict_mode; }
     std::string debug_string() const;
 
@@ -107,6 +108,7 @@ private:
     bool _is_partial_update = false;
     std::set<std::string> _partial_update_input_columns;
     bool _is_strict_mode = false;
+    std::string _auto_increment_column;
 };
 
 using OlapTableIndexTablets = TOlapTableIndexTablets;
diff --git a/be/src/olap/delta_writer_v2.cpp b/be/src/olap/delta_writer_v2.cpp
index a9b8ff58f34..701b897f3cb 100644
--- a/be/src/olap/delta_writer_v2.cpp
+++ b/be/src/olap/delta_writer_v2.cpp
@@ -229,13 +229,17 @@ void DeltaWriterV2::_build_current_tablet_schema(int64_t 
index_id,
         }
     }
 
-    if (indexes.size() > 0 && indexes[i]->columns.size() != 0 &&
+    if (!indexes.empty() && !indexes[i]->columns.empty() &&
         indexes[i]->columns[0]->unique_id() >= 0) {
         _tablet_schema->build_current_tablet_schema(index_id, 
table_schema_param->version(),
                                                     indexes[i], 
ori_tablet_schema);
     }
 
     _tablet_schema->set_table_id(table_schema_param->table_id());
+    _tablet_schema->set_db_id(table_schema_param->db_id());
+    if (table_schema_param->is_partial_update()) {
+        
_tablet_schema->set_auto_increment_column(table_schema_param->auto_increment_coulumn());
+    }
     // set partial update columns info
     _partial_update_info = std::make_shared<PartialUpdateInfo>();
     _partial_update_info->init(*_tablet_schema, 
table_schema_param->is_partial_update(),
diff --git a/be/src/olap/partial_update_info.h 
b/be/src/olap/partial_update_info.h
index cdea698b20d..89ab5eadf3e 100644
--- a/be/src/olap/partial_update_info.h
+++ b/be/src/olap/partial_update_info.h
@@ -32,7 +32,8 @@ struct PartialUpdateInfo {
             auto tablet_column = tablet_schema.column(i);
             if (!partial_update_input_columns.contains(tablet_column.name())) {
                 missing_cids.emplace_back(i);
-                if (!tablet_column.has_default_value() && 
!tablet_column.is_nullable()) {
+                if (!tablet_column.has_default_value() && 
!tablet_column.is_nullable() &&
+                    tablet_schema.auto_increment_column() != 
tablet_column.name()) {
                     can_insert_new_rows_in_partial_update = false;
                 }
             } else {
diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/segment_writer.cpp
index 7613642ef99..f054a79db50 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp
@@ -107,6 +107,13 @@ SegmentWriter::SegmentWriter(io::FileWriter* file_writer, 
uint32_t segment_id,
             const auto& column = 
_tablet_schema->column(_tablet_schema->sequence_col_idx());
             _seq_coder = get_key_coder(column.type());
         }
+        if (!_tablet_schema->auto_increment_column().empty()) {
+            _auto_inc_id_buffer =
+                    
vectorized::GlobalAutoIncBuffers::GetInstance()->get_auto_inc_buffer(
+                            _tablet_schema->db_id(), 
_tablet_schema->table_id(),
+                            
_tablet_schema->column(_tablet_schema->auto_increment_column())
+                                    .unique_id());
+        }
         // encode the rowid into the primary key index
         if (!_tablet_schema->cluster_key_idxes().empty()) {
             const auto* type_info = 
get_scalar_type_info<FieldType::OLAP_FIELD_TYPE_UNSIGNED_INT>();
@@ -478,7 +485,8 @@ Status 
SegmentWriter::append_block_with_partial_content(const vectorized::Block*
                     std::string error_column;
                     for (auto cid : 
_opts.rowset_ctx->partial_update_info->missing_cids) {
                         const TabletColumn& col = _tablet_schema->column(cid);
-                        if (!col.has_default_value() && !col.is_nullable()) {
+                        if (!col.has_default_value() && !col.is_nullable() &&
+                            _tablet_schema->auto_increment_column() != 
col.name()) {
                             error_column = col.name();
                             break;
                         }
@@ -664,6 +672,18 @@ Status 
SegmentWriter::fill_missing_columns(vectorized::MutableColumns& mutable_f
         }
     }
 
+    // deal with partial update auto increment column when there no key in old 
block.
+    if (!_tablet_schema->auto_increment_column().empty()) {
+        if (_auto_inc_id_allocator.total_count < 
use_default_or_null_flag.size()) {
+            std::vector<std::pair<int64_t, size_t>> res;
+            RETURN_IF_ERROR(
+                    
_auto_inc_id_buffer->sync_request_ids(use_default_or_null_flag.size(), &res));
+            for (auto [start, length] : res) {
+                _auto_inc_id_allocator.insert_ids(start, length);
+            }
+        }
+    }
+
     // fill all missing value from mutable_old_columns, need to consider 
default value and null value
     for (auto idx = 0; idx < use_default_or_null_flag.size(); idx++) {
         // `use_default_or_null_flag[idx] == true` doesn't mean that we should 
read values from the old row
@@ -686,6 +706,12 @@ Status 
SegmentWriter::fill_missing_columns(vectorized::MutableColumns& mutable_f
                     auto nullable_column = 
assert_cast<vectorized::ColumnNullable*>(
                             mutable_full_columns[cids_missing[i]].get());
                     nullable_column->insert_null_elements(1);
+                } else if (_tablet_schema->auto_increment_column() == 
tablet_column.name()) {
+                    
DCHECK(_opts.rowset_ctx->tablet_schema->column(tablet_column.name()).type() ==
+                           FieldType::OLAP_FIELD_TYPE_BIGINT);
+                    auto auto_inc_column = 
assert_cast<vectorized::ColumnInt64*>(
+                            mutable_full_columns[cids_missing[i]].get());
+                    auto_inc_column->insert(_auto_inc_id_allocator.next_id());
                 } else {
                     // If the control flow reaches this branch, the column 
neither has default value
                     // nor is nullable. It means that the row's delete sign is 
marked, and the value
diff --git a/be/src/olap/rowset/segment_v2/segment_writer.h 
b/be/src/olap/rowset/segment_v2/segment_writer.h
index 682aa55d01a..d5d3a11ba73 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.h
+++ b/be/src/olap/rowset/segment_v2/segment_writer.h
@@ -40,6 +40,7 @@
 #include "olap/tablet_schema.h"
 #include "util/faststring.h"
 #include "util/slice.h"
+#include "vec/sink/autoinc_buffer.h"
 
 namespace doris {
 namespace vectorized {
@@ -224,7 +225,8 @@ private:
     PartialUpdateReadPlan _rssid_to_rid;
     std::map<RowsetId, RowsetSharedPtr> _rsid_to_rowset;
 
-    // record row locations here and used when memtable flush
+    std::shared_ptr<vectorized::AutoIncIDBuffer> _auto_inc_id_buffer = nullptr;
+    vectorized::AutoIncIDAllocator _auto_inc_id_allocator;
 };
 
 } // namespace segment_v2
diff --git a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
index cc208d3903e..fd0b125628b 100644
--- a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
@@ -52,6 +52,7 @@
 #include "util/faststring.h"
 #include "util/key_util.h"
 #include "vec/columns/column_nullable.h"
+#include "vec/columns/columns_number.h"
 #include "vec/common/schema_util.h"
 #include "vec/core/block.h"
 #include "vec/core/column_with_type_and_name.h"
@@ -97,6 +98,11 @@ VerticalSegmentWriter::VerticalSegmentWriter(io::FileWriter* 
file_writer, uint32
         const auto& column = 
_tablet_schema->column(_tablet_schema->sequence_col_idx());
         _seq_coder = get_key_coder(column.type());
     }
+    if (!_tablet_schema->auto_increment_column().empty()) {
+        _auto_inc_id_buffer = 
vectorized::GlobalAutoIncBuffers::GetInstance()->get_auto_inc_buffer(
+                _tablet_schema->db_id(), _tablet_schema->table_id(),
+                
_tablet_schema->column(_tablet_schema->auto_increment_column()).unique_id());
+    }
 }
 
 VerticalSegmentWriter::~VerticalSegmentWriter() {
@@ -411,7 +417,8 @@ Status 
VerticalSegmentWriter::_append_block_with_partial_content(RowsInBlock& da
                     std::string error_column;
                     for (auto cid : 
_opts.rowset_ctx->partial_update_info->missing_cids) {
                         const TabletColumn& col = _tablet_schema->column(cid);
-                        if (!col.has_default_value() && !col.is_nullable()) {
+                        if (!col.has_default_value() && !col.is_nullable() &&
+                            !(_tablet_schema->auto_increment_column() == 
col.name())) {
                             error_column = col.name();
                             break;
                         }
@@ -596,6 +603,18 @@ Status VerticalSegmentWriter::_fill_missing_columns(
         }
     }
 
+    // deal with partial update auto increment column when there no key in old 
block.
+    if (!_tablet_schema->auto_increment_column().empty()) {
+        if (_auto_inc_id_allocator.total_count < 
use_default_or_null_flag.size()) {
+            std::vector<std::pair<int64_t, size_t>> res;
+            RETURN_IF_ERROR(
+                    
_auto_inc_id_buffer->sync_request_ids(use_default_or_null_flag.size(), &res));
+            for (auto [start, length] : res) {
+                _auto_inc_id_allocator.insert_ids(start, length);
+            }
+        }
+    }
+
     // fill all missing value from mutable_old_columns, need to consider 
default value and null value
     for (auto idx = 0; idx < use_default_or_null_flag.size(); idx++) {
         // `use_default_or_null_flag[idx] == true` doesn't mean that we should 
read values from the old row
@@ -618,6 +637,12 @@ Status VerticalSegmentWriter::_fill_missing_columns(
                     auto nullable_column = 
assert_cast<vectorized::ColumnNullable*>(
                             mutable_full_columns[missing_cids[i]].get());
                     nullable_column->insert_null_elements(1);
+                } else if (_tablet_schema->auto_increment_column() == 
tablet_column.name()) {
+                    
DCHECK(_opts.rowset_ctx->tablet_schema->column(tablet_column.name()).type() ==
+                           FieldType::OLAP_FIELD_TYPE_BIGINT);
+                    auto auto_inc_column = 
assert_cast<vectorized::ColumnInt64*>(
+                            mutable_full_columns[missing_cids[i]].get());
+                    auto_inc_column->insert(_auto_inc_id_allocator.next_id());
                 } else {
                     // If the control flow reaches this branch, the column 
neither has default value
                     // nor is nullable. It means that the row's delete sign is 
marked, and the value
diff --git a/be/src/olap/rowset/segment_v2/vertical_segment_writer.h 
b/be/src/olap/rowset/segment_v2/vertical_segment_writer.h
index 44c30018f0b..806b3075487 100644
--- a/be/src/olap/rowset/segment_v2/vertical_segment_writer.h
+++ b/be/src/olap/rowset/segment_v2/vertical_segment_writer.h
@@ -38,6 +38,7 @@
 #include "olap/tablet_schema.h"
 #include "util/faststring.h"
 #include "util/slice.h"
+#include "vec/sink/autoinc_buffer.h"
 
 namespace doris {
 namespace vectorized {
@@ -190,6 +191,8 @@ private:
     std::map<RowsetId, RowsetSharedPtr> _rsid_to_rowset;
 
     std::vector<RowsInBlock> _batched_blocks;
+    std::shared_ptr<vectorized::AutoIncIDBuffer> _auto_inc_id_buffer = nullptr;
+    vectorized::AutoIncIDAllocator _auto_inc_id_allocator;
 };
 
 } // namespace segment_v2
diff --git a/be/src/olap/rowset_builder.cpp b/be/src/olap/rowset_builder.cpp
index ecfba5cebb9..8e9d87ec259 100644
--- a/be/src/olap/rowset_builder.cpp
+++ b/be/src/olap/rowset_builder.cpp
@@ -361,6 +361,10 @@ void 
BaseRowsetBuilder::_build_current_tablet_schema(int64_t index_id,
     }
 
     _tablet_schema->set_table_id(table_schema_param->table_id());
+    _tablet_schema->set_db_id(table_schema_param->db_id());
+    if (table_schema_param->is_partial_update()) {
+        
_tablet_schema->set_auto_increment_column(table_schema_param->auto_increment_coulumn());
+    }
     // set partial update columns info
     _partial_update_info = std::make_shared<PartialUpdateInfo>();
     _partial_update_info->init(*_tablet_schema, 
table_schema_param->is_partial_update(),
diff --git a/be/src/olap/tablet_meta.cpp b/be/src/olap/tablet_meta.cpp
index 75ed4a909f3..1bb007ca597 100644
--- a/be/src/olap/tablet_meta.cpp
+++ b/be/src/olap/tablet_meta.cpp
@@ -327,6 +327,7 @@ void TabletMeta::init_column_from_tcolumn(uint32_t 
unique_id, const TColumn& tco
     column->set_unique_id(unique_id);
     column->set_name(tcolumn.column_name);
     column->set_has_bitmap_index(tcolumn.has_bitmap_index);
+    column->set_is_auto_increment(tcolumn.is_auto_increment);
     string data_type;
     EnumToString(TPrimitiveType, tcolumn.column_type.type, data_type);
     column->set_type(data_type);
diff --git a/be/src/olap/tablet_schema.cpp b/be/src/olap/tablet_schema.cpp
index 78c7e694c6f..b7aaf0c6e53 100644
--- a/be/src/olap/tablet_schema.cpp
+++ b/be/src/olap/tablet_schema.cpp
@@ -504,6 +504,7 @@ void TabletColumn::init_from_pb(const ColumnPB& column) {
     _type = TabletColumn::get_field_type_by_string(column.type());
     _is_key = column.is_key();
     _is_nullable = column.is_nullable();
+    _is_auto_increment = column.is_auto_increment();
 
     _has_default_value = column.has_default_value();
     if (_has_default_value) {
diff --git a/be/src/olap/tablet_schema.h b/be/src/olap/tablet_schema.h
index d4a1919101a..9e449e595b6 100644
--- a/be/src/olap/tablet_schema.h
+++ b/be/src/olap/tablet_schema.h
@@ -78,6 +78,7 @@ public:
     void set_type(FieldType type) { _type = type; }
     bool is_key() const { return _is_key; }
     bool is_nullable() const { return _is_nullable; }
+    bool is_auto_increment() const { return _is_auto_increment; }
     bool is_variant_type() const { return _type == 
FieldType::OLAP_FIELD_TYPE_VARIANT; }
     bool is_bf_column() const { return _is_bf_column; }
     bool has_bitmap_index() const { return _has_bitmap_index; }
@@ -109,6 +110,7 @@ public:
     void set_index_length(size_t index_length) { _index_length = index_length; 
}
     void set_is_key(bool is_key) { _is_key = is_key; }
     void set_is_nullable(bool is_nullable) { _is_nullable = is_nullable; }
+    void set_is_auto_increment(bool is_auto_increment) { _is_auto_increment = 
is_auto_increment; }
     void set_has_default_value(bool has) { _has_default_value = has; }
     void set_path_info(const vectorized::PathInData& path);
     FieldAggregationMethod aggregation() const { return _aggregation; }
@@ -167,6 +169,7 @@ private:
     FieldAggregationMethod _aggregation;
     std::string _aggregation_name;
     bool _is_nullable = false;
+    bool _is_auto_increment = false;
 
     bool _has_default_value = false;
     std::string _default_value;
@@ -337,9 +340,15 @@ public:
             const std::unordered_set<uint32_t>* 
tablet_columns_need_convert_null = nullptr) const;
     vectorized::Block create_block(bool ignore_dropped_col = true) const;
     void set_schema_version(int32_t version) { _schema_version = version; }
+    void set_auto_increment_column(const std::string& auto_increment_column) {
+        _auto_increment_column = auto_increment_column;
+    }
+    std::string auto_increment_column() const { return _auto_increment_column; 
}
 
     void set_table_id(int32_t table_id) { _table_id = table_id; }
     int32_t table_id() const { return _table_id; }
+    void set_db_id(int32_t db_id) { _db_id = db_id; }
+    int32_t db_id() const { return _db_id; }
     void build_current_tablet_schema(int64_t index_id, int32_t version,
                                      const OlapTableIndexSchema* index,
                                      const TabletSchema& out_tablet_schema);
@@ -425,6 +434,7 @@ private:
     CompressKind _compress_kind = COMPRESS_NONE;
     segment_v2::CompressionTypePB _compression_type = 
segment_v2::CompressionTypePB::LZ4F;
     size_t _next_column_unique_id = 0;
+    std::string _auto_increment_column;
 
     bool _has_bf_fpp = false;
     double _bf_fpp = 0;
@@ -434,6 +444,7 @@ private:
     int32_t _version_col_idx = -1;
     int32_t _schema_version = -1;
     int32_t _table_id = -1;
+    int32_t _db_id = -1;
     bool _disable_auto_compaction = false;
     bool _enable_single_replica_compaction = false;
     int64_t _mem_size = 0;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java
index f27ed9099dc..8406cb53636 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java
@@ -301,6 +301,11 @@ public class OlapTableSink extends DataSink {
             for (String s : partialUpdateInputColumns) {
                 schemaParam.addToPartialUpdateInputColumns(s);
             }
+            for (Column col : table.getFullSchema()) {
+                if (col.isAutoInc()) {
+                    schemaParam.setAutoIncrementColumn(col.getName());
+                }
+            }
         }
         return schemaParam;
     }
diff --git a/gensrc/proto/descriptors.proto b/gensrc/proto/descriptors.proto
index 8762a78c0f4..4a398759d9c 100644
--- a/gensrc/proto/descriptors.proto
+++ b/gensrc/proto/descriptors.proto
@@ -69,5 +69,6 @@ message POlapTableSchemaParam {
     optional bool partial_update = 7 [default = false];
     repeated string partial_update_input_columns = 8;
     optional bool is_strict_mode = 9 [default = false];
+    optional string auto_increment_column = 10;
 };
 
diff --git a/gensrc/proto/olap_file.proto b/gensrc/proto/olap_file.proto
index 66e9f084992..f14ba235640 100644
--- a/gensrc/proto/olap_file.proto
+++ b/gensrc/proto/olap_file.proto
@@ -210,6 +210,7 @@ message ColumnPB {
     optional segment_v2.ColumnPathInfo column_path_info = 20;
     // sparse column within a variant column
     repeated ColumnPB sparse_columns = 21;
+    optional bool is_auto_increment = 22;
 }
 
 enum IndexType {
diff --git a/gensrc/thrift/Descriptors.thrift b/gensrc/thrift/Descriptors.thrift
index 71af587d715..cde4cb043af 100644
--- a/gensrc/thrift/Descriptors.thrift
+++ b/gensrc/thrift/Descriptors.thrift
@@ -234,7 +234,8 @@ struct TOlapTableSchemaParam {
     7: optional bool is_dynamic_schema // deprecated
     8: optional bool is_partial_update
     9: optional list<string> partial_update_input_columns
-    10: optional bool is_strict_mode = false;
+    10: optional bool is_strict_mode = false
+    11: optional string auto_increment_column
 }
 
 struct TTabletLocation {
diff --git 
a/regression-test/data/data_model_p0/unique/auto_inc_partial_update3.csv 
b/regression-test/data/data_model_p0/unique/auto_inc_partial_update3.csv
new file mode 100644
index 00000000000..ea2ce0cc490
--- /dev/null
+++ b/regression-test/data/data_model_p0/unique/auto_inc_partial_update3.csv
@@ -0,0 +1,5 @@
+BBob, 9990
+TTom, 9992
+CCarter, 9994
+BBeata, 9996
+NNereids, 9998
\ No newline at end of file
diff --git 
a/regression-test/data/data_model_p0/unique/test_unique_table_auto_inc.out 
b/regression-test/data/data_model_p0/unique/test_unique_table_auto_inc.out
index 1fad44b368f..60fe3b765e3 100644
--- a/regression-test/data/data_model_p0/unique/test_unique_table_auto_inc.out
+++ b/regression-test/data/data_model_p0/unique/test_unique_table_auto_inc.out
@@ -138,6 +138,22 @@ Beata      9996    7
 Doris  800     8
 Nereids        9998    9
 
+-- !partial_update_value --
+Bob    9990    1
+Alice  200     2
+Tom    9992    3
+Test   400     4
+Carter 9994    5
+Smith  600     6
+Beata  9996    7
+Doris  800     8
+Nereids        9998    9
+BBeata 9996    15
+BBob   9990    16
+CCarter        9994    17
+NNereids       9998    18
+TTom   9992    19
+
 -- !sql --
 1      a
 2      b
diff --git a/regression-test/data/fault_injection_p0/concurrency_update2.csv 
b/regression-test/data/fault_injection_p0/concurrency_update2.csv
index 23f43edc585..1ee5a5ca403 100644
--- a/regression-test/data/fault_injection_p0/concurrency_update2.csv
+++ b/regression-test/data/fault_injection_p0/concurrency_update2.csv
@@ -19,3 +19,8 @@
 
18,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
19,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
20,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+21,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+22,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+23,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+24,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+25,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/regression-test/data/fault_injection_p0/concurrency_update3.csv 
b/regression-test/data/fault_injection_p0/concurrency_update3.csv
index e2dd51a2dcc..2df758f553d 100644
--- a/regression-test/data/fault_injection_p0/concurrency_update3.csv
+++ b/regression-test/data/fault_injection_p0/concurrency_update3.csv
@@ -19,3 +19,8 @@
 18,b18
 19,b19
 20,b20
+26,b26
+27,b27
+28,b28
+29,b29
+20,b30
diff --git 
a/regression-test/data/fault_injection_p0/test_partial_update_publish_conflict_with_error.out
 
b/regression-test/data/fault_injection_p0/test_partial_update_publish_conflict_with_error.out
index 4e4d3f19f6e..bcdbd86093b 100644
--- 
a/regression-test/data/fault_injection_p0/test_partial_update_publish_conflict_with_error.out
+++ 
b/regression-test/data/fault_injection_p0/test_partial_update_publish_conflict_with_error.out
@@ -1,47 +1,56 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !sql --
-0      \N      \N      \N      \N      \N
-1      \N      \N      \N      \N      \N
-10     \N      \N      \N      \N      \N
-11     \N      \N      \N      \N      \N
-12     \N      \N      \N      \N      \N
-13     \N      \N      \N      \N      \N
-14     \N      \N      \N      \N      \N
-15     \N      \N      \N      \N      \N
-16     \N      \N      \N      \N      \N
-17     \N      \N      \N      \N      \N
-18     \N      \N      \N      \N      \N
-19     \N      \N      \N      \N      \N
-2      \N      \N      \N      \N      \N
-20     \N      \N      \N      \N      \N
-3      \N      \N      \N      \N      \N
-4      \N      \N      \N      \N      \N
-5      \N      \N      \N      \N      \N
-6      \N      \N      \N      \N      \N
-7      \N      \N      \N      \N      \N
-8      \N      \N      \N      \N      \N
-9      \N      \N      \N      \N      \N
+0      \N      \N      \N      \N      \N      100
+1      \N      \N      \N      \N      \N      101
+10     \N      \N      \N      \N      \N      110
+11     \N      \N      \N      \N      \N      111
+12     \N      \N      \N      \N      \N      112
+13     \N      \N      \N      \N      \N      113
+14     \N      \N      \N      \N      \N      114
+15     \N      \N      \N      \N      \N      115
+16     \N      \N      \N      \N      \N      116
+17     \N      \N      \N      \N      \N      117
+18     \N      \N      \N      \N      \N      118
+19     \N      \N      \N      \N      \N      119
+2      \N      \N      \N      \N      \N      102
+20     \N      \N      \N      \N      \N      120
+3      \N      \N      \N      \N      \N      103
+4      \N      \N      \N      \N      \N      104
+5      \N      \N      \N      \N      \N      105
+6      \N      \N      \N      \N      \N      106
+7      \N      \N      \N      \N      \N      107
+8      \N      \N      \N      \N      \N      108
+9      \N      \N      \N      \N      \N      109
 
 -- !sql --
-0      aaaaaaaaaa      b0      \N      \N      \N
-1      aaaaaaaaaa      b1      \N      \N      \N
-10     aaaaaaaaaa      b10     \N      \N      \N
-11     aaaaaaaaaa      b11     \N      \N      \N
-12     aaaaaaaaaa      b12     \N      \N      \N
-13     aaaaaaaaaa      b13     \N      \N      \N
-14     aaaaaaaaaa      b14     \N      \N      \N
-15     aaaaaaaaaa      b15     \N      \N      \N
-16     aaaaaaaaaa      b16     \N      \N      \N
-17     aaaaaaaaaa      b17     \N      \N      \N
-18     aaaaaaaaaa      b18     \N      \N      \N
-19     aaaaaaaaaa      b19     \N      \N      \N
-2      aaaaaaaaaa      b2      \N      \N      \N
-20     aaaaaaaaaa      b20     \N      \N      \N
-3      aaaaaaaaaa      b3      \N      \N      \N
-4      aaaaaaaaaa      b4      \N      \N      \N
-5      aaaaaaaaaa      b5      \N      \N      \N
-6      aaaaaaaaaa      b6      \N      \N      \N
-7      aaaaaaaaaa      b7      \N      \N      \N
-8      aaaaaaaaaa      b8      \N      \N      \N
-9      aaaaaaaaaa      b9      \N      \N      \N
+0      aaaaaaaaaa      b0      \N      \N      \N      100
+1      aaaaaaaaaa      b1      \N      \N      \N      101
+10     aaaaaaaaaa      b10     \N      \N      \N      110
+11     aaaaaaaaaa      b11     \N      \N      \N      111
+12     aaaaaaaaaa      b12     \N      \N      \N      112
+13     aaaaaaaaaa      b13     \N      \N      \N      113
+14     aaaaaaaaaa      b14     \N      \N      \N      114
+15     aaaaaaaaaa      b15     \N      \N      \N      115
+16     aaaaaaaaaa      b16     \N      \N      \N      116
+17     aaaaaaaaaa      b17     \N      \N      \N      117
+18     aaaaaaaaaa      b18     \N      \N      \N      118
+19     aaaaaaaaaa      b19     \N      \N      \N      119
+2      aaaaaaaaaa      b2      \N      \N      \N      102
+20     aaaaaaaaaa      b30     \N      \N      \N      120
+21     aaaaaaaaaa      \N      \N      \N      \N      121
+22     aaaaaaaaaa      \N      \N      \N      \N      122
+23     aaaaaaaaaa      \N      \N      \N      \N      123
+24     aaaaaaaaaa      \N      \N      \N      \N      124
+25     aaaaaaaaaa      \N      \N      \N      \N      125
+26     \N      b26     \N      \N      \N      147
+27     \N      b27     \N      \N      \N      148
+28     \N      b28     \N      \N      \N      149
+29     \N      b29     \N      \N      \N      150
+3      aaaaaaaaaa      b3      \N      \N      \N      103
+4      aaaaaaaaaa      b4      \N      \N      \N      104
+5      aaaaaaaaaa      b5      \N      \N      \N      105
+6      aaaaaaaaaa      b6      \N      \N      \N      106
+7      aaaaaaaaaa      b7      \N      \N      \N      107
+8      aaaaaaaaaa      b8      \N      \N      \N      108
+9      aaaaaaaaaa      b9      \N      \N      \N      109
 
diff --git 
a/regression-test/suites/data_model_p0/unique/test_unique_table_auto_inc.groovy 
b/regression-test/suites/data_model_p0/unique/test_unique_table_auto_inc.groovy
index 20315e8af4d..16ab4f7abb4 100644
--- 
a/regression-test/suites/data_model_p0/unique/test_unique_table_auto_inc.groovy
+++ 
b/regression-test/suites/data_model_p0/unique/test_unique_table_auto_inc.groovy
@@ -294,8 +294,21 @@ suite("test_unique_table_auto_inc") {
     }
     sql "sync"
     qt_partial_update_value "select * from ${table7} order by id;"
-    sql "drop table if exists ${table7};"
 
+    streamLoad {
+        table "${table7}"
+
+        set 'column_separator', ','
+        set 'format', 'csv'
+        set 'columns', 'name, value'
+        set 'partial_columns', 'true'
+
+        file 'auto_inc_partial_update3.csv'
+        time 10000
+    }
+    sql "sync"
+    qt_partial_update_value "select * from ${table7} order by id;"
+    sql "drop table if exists ${table7};"
 
     def table8 = "test_auto_inc_col_create_as_select1"
     def table9 = "test_auto_inc_col_create_as_select2"
diff --git 
a/regression-test/suites/fault_injection_p0/test_partial_update_publish_conflict_with_error.groovy
 
b/regression-test/suites/fault_injection_p0/test_partial_update_publish_conflict_with_error.groovy
index 29b5bcaaed6..1608dcaae54 100644
--- 
a/regression-test/suites/fault_injection_p0/test_partial_update_publish_conflict_with_error.groovy
+++ 
b/regression-test/suites/fault_injection_p0/test_partial_update_publish_conflict_with_error.groovy
@@ -45,7 +45,9 @@ suite("test_partial_update_publish_conflict_with_error", 
"nonConcurrent") {
         v2 varchar(20),
         v3 varchar(20),
         v4 varchar(20),
-        v5 varchar(20))
+        v5 varchar(20),
+        v6 bigint not null auto_increment(100)
+        )
         UNIQUE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 1
         PROPERTIES(
             "replication_num" = "1",


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

Reply via email to