wangbo commented on code in PR #8855:
URL: https://github.com/apache/incubator-doris/pull/8855#discussion_r849435187


##########
be/src/olap/rowset/alpha_rowset.cpp:
##########
@@ -175,63 +175,61 @@ OLAPStatus AlphaRowset::split_range(const RowCursor& 
start_key, const RowCursor&
                      << "-" << end_version() << ". tablet: " << 
rowset_meta()->tablet_id();
         ranges->emplace_back(start_key.to_tuple());
         ranges->emplace_back(end_key.to_tuple());
-        return OLAP_SUCCESS;
+        return Status::OK();
     }
     uint64_t expected_rows =
             request_block_row_count / 
largest_segment_group->current_num_rows_per_row_block();
     if (expected_rows == 0) {
         LOG(WARNING) << "expected_rows less than 1. [request_block_row_count = 
"
                      << request_block_row_count << "]";
-        return OLAP_ERR_INVALID_SCHEMA;
+        return Status::OLAPInternalError(OLAP_ERR_INVALID_SCHEMA);
     }
 
     // find the start position of start key
     RowCursor helper_cursor;
-    if (helper_cursor.init(*_schema, key_num) != OLAP_SUCCESS) {
+    if (helper_cursor.init(*_schema, key_num) != Status::OK()) {
         LOG(WARNING) << "fail to parse strings to key with RowCursor type.";
-        return OLAP_ERR_INVALID_SCHEMA;
+        return Status::OLAPInternalError(OLAP_ERR_INVALID_SCHEMA);
     }
-    if (largest_segment_group->find_short_key(start_key, &helper_cursor, 
false, &start_pos) !=
-        OLAP_SUCCESS) {
-        if (largest_segment_group->find_first_row_block(&start_pos) != 
OLAP_SUCCESS) {
+    if (!largest_segment_group->find_short_key(start_key, &helper_cursor, 
false, &start_pos)) {
+        if (!largest_segment_group->find_first_row_block(&start_pos)) {
             LOG(WARNING) << "fail to get first block pos";
-            return OLAP_ERR_TABLE_INDEX_FIND_ERROR;
+            return Status::OLAPInternalError(OLAP_ERR_TABLE_INDEX_FIND_ERROR);
         }
     }
 
     step_pos = start_pos;
     VLOG_NOTICE << "start_pos=" << start_pos.segment << ", " << 
start_pos.index_offset;
 
     //find last row_block is end_key is given, or using last_row_block
-    if (largest_segment_group->find_short_key(end_key, &helper_cursor, false, 
&end_pos) !=
-        OLAP_SUCCESS) {
-        if (largest_segment_group->find_last_row_block(&end_pos) != 
OLAP_SUCCESS) {
+    if (!largest_segment_group->find_short_key(end_key, &helper_cursor, false, 
&end_pos)) {
+        if (!largest_segment_group->find_last_row_block(&end_pos)) {

Review Comment:
   ```suggestion
           if (largest_segment_group->find_last_row_block(&end_pos) != 
Status::OK()) {
   ```



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