github-actions[bot] commented on code in PR #24972:
URL: https://github.com/apache/doris/pull/24972#discussion_r1377820756


##########
be/src/olap/reader.cpp:
##########
@@ -684,4 +687,19 @@ Status TabletReader::init_reader_params_and_create_block(
     return Status::OK();
 }
 
+Status TabletReader::push_late_arrival_runtime_filter(const IRuntimeFilter* 
filter,

Review Comment:
   warning: method 'push_late_arrival_runtime_filter' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/olap/reader.h:225:
   ```diff
   -     Status push_late_arrival_runtime_filter(const IRuntimeFilter* filter,
   +     static Status push_late_arrival_runtime_filter(const IRuntimeFilter* 
filter,
   ```
   



##########
be/src/exprs/runtime_filter.h:
##########
@@ -358,7 +358,15 @@ class IRuntimeFilter {
         return use_batch && (is_int_or_bool(type) || is_float_or_double(type));
     }
 
-    int filter_id() const { return _filter_id; }
+    [[nodiscard]] int filter_id() const { return _filter_id; }
+
+    [[nodiscard]] int slot_id() const;
+
+    Status create_column_predicates(const doris::TabletColumn& column, const 
int column_index,

Review Comment:
   warning: parameter 'column_index' is const-qualified in the function 
declaration; const-qualification of parameters only has an effect in function 
definitions [readability-avoid-const-params-in-decls]
   
   ```suggestion
       Status create_column_predicates(const doris::TabletColumn& column, int 
column_index,
   ```
   



##########
be/test/util/date_func_test.cpp:
##########
@@ -32,16 +33,18 @@ class DateFuncTest : public testing::Test {
 };
 
 TEST_F(DateFuncTest, convert_string_to_int) {
-    uint64_t result1 = timestamp_from_datetime(std::string("2021-06-08 
15:21:18"));
+    uint64_t result1 =
+            timestamp_from_datetime(std::string("2021-06-08 
15:21:18")).to_olap_datetime();

Review Comment:
   warning: 20210608152118 is a magic number; consider replacing it with a 
named constant [readability-magic-numbers]
   ```cpp
       EXPECT_EQ(20210608152118, result1);
                 ^
   ```
   



##########
be/test/util/date_func_test.cpp:
##########
@@ -32,16 +33,18 @@
 };
 
 TEST_F(DateFuncTest, convert_string_to_int) {
-    uint64_t result1 = timestamp_from_datetime(std::string("2021-06-08 
15:21:18"));
+    uint64_t result1 =
+            timestamp_from_datetime(std::string("2021-06-08 
15:21:18")).to_olap_datetime();
     EXPECT_EQ(20210608152118, result1);
 
-    uint64_t abnormal_result1 = 
timestamp_from_datetime(std::string("2021-22-08 15:21:18"));
+    uint64_t abnormal_result1 =

Review Comment:
   warning: 14000101000000 is a magic number; consider replacing it with a 
named constant [readability-magic-numbers]
   ```cpp
       EXPECT_EQ(14000101000000, abnormal_result1);
                 ^
   ```
   



##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -144,6 +144,36 @@ class SegmentIterator::BitmapRangeIterator {
         return true;
     }
 
+    virtual void seek_at_of_after(const uint32_t row) {
+        while (!_eof && _buf[_buf_size - 1] < row) {
+            _read_next_batch();
+        }
+
+        if (_eof) {
+            return;
+        }
+
+        int left = 0;
+        int right = _buf_size - 1;
+
+        while (left <= right) {
+            int mid = (left + right) / 2;
+
+            if (_buf[mid] == row) {
+                _buf_pos = mid;
+                return;
+            } else if (_buf[mid] < row) {
+                left = mid + 1;
+            } else {
+                right = mid - 1;
+            }

Review Comment:
   warning: do not use 'else' after 'return' [readability-else-after-return]
   
   ```suggestion
               } if (_buf[mid] < row) {
                   left = mid + 1;
               } else {
                   right = mid - 1;
               }
   ```
   



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