carlvinhust2012 commented on code in PR #18686:
URL: https://github.com/apache/doris/pull/18686#discussion_r1169873051


##########
be/src/olap/memtable.h:
##########
@@ -88,6 +88,26 @@ class MemTable {
         char* agg_places(size_t offset) const { return _agg_mem + 
_agg_state_offset[offset]; }
     };
 
+    class RowComparator {
+    public:
+        RowComparator(const Schema* schema) : _schema(schema) {}
+
+        void set_block(vectorized::MutableBlock* pblock) { _pblock = pblock; }
+
+        int compare(const RowInBlock* left, const RowInBlock* right) const {
+            return _pblock->compare_at(left->_row_pos, right->_row_pos, 
_schema->num_key_columns(),
+                                       *_pblock, -1);
+        }
+
+        bool operator()(const RowInBlock* left, const RowInBlock* right) const 
{
+            return compare(left, right) < 0;
+        }
+
+    private:
+        const Schema* _schema;
+        vectorized::MutableBlock* _pblock; // 对应Memtable::_input_mutable_block

Review Comment:
   here may be use English comment is more better



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