diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp index 207778becae4d6..6476012fde601d 100644 --- a/be/src/olap/memtable.cpp +++ b/be/src/olap/memtable.cpp @@ -505,7 +505,7 @@ bool MemTable::need_agg() const { return false; } -Status MemTable::to_block(std::unique_ptr* res) { +Status MemTable::_to_block(std::unique_ptr* res) { size_t same_keys_num = _sort(); if (_keys_type == KeysType::DUP_KEYS || same_keys_num == 0) { if (_keys_type == KeysType::DUP_KEYS && _tablet_schema->num_key_columns() == 0) { @@ -529,4 +529,9 @@ Status MemTable::to_block(std::unique_ptr* res) { return Status::OK(); } +Status MemTable::to_block(std::unique_ptr* res) { + RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_to_block(res)); + return Status::OK(); +} + } // namespace doris diff --git a/be/src/olap/memtable.h b/be/src/olap/memtable.h index 916067ba1193d2..70f7a9f22a0aa8 100644 --- a/be/src/olap/memtable.h +++ b/be/src/olap/memtable.h @@ -205,6 +205,9 @@ class MemTable { void _aggregate_two_row_in_block(vectorized::MutableBlock& mutable_block, RowInBlock* new_row, RowInBlock* row_in_skiplist); + // Used to wrapped by to_block to do exception handle logic + Status _to_block(std::unique_ptr* res); + private: int64_t _tablet_id; bool _enable_unique_key_mow = false;