You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/08 15:08:27 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #7319: [refactor] modify the implements of tuple & RowBatch

morningman commented on a change in pull request #7319:
URL: https://github.com/apache/incubator-doris/pull/7319#discussion_r764952237



##########
File path: be/src/runtime/row_batch.cpp
##########
@@ -120,37 +120,39 @@ RowBatch::RowBatch(const RowDescriptor& row_desc, const PRowBatch& input_batch,
         if (offset == -1) {
             _tuple_ptrs[tuple_idx++] = nullptr;
         } else {
-            _tuple_ptrs[tuple_idx++] = reinterpret_cast<Tuple*>(tuple_data + offset);
+            _tuple_ptrs[tuple_idx++] = convert_to<Tuple*>(tuple_data + offset);
         }
     }
 
     // Check whether we have slots that require offset-to-pointer conversion.
     if (!_row_desc.has_varlen_slots()) {
         return;
     }
-    const std::vector<TupleDescriptor*>& tuple_descs = _row_desc.tuple_descriptors();
+
+    const auto& tuple_descs = _row_desc.tuple_descriptors();
 
     // For every unique tuple, convert string offsets contained in tuple data into
     // pointers. Tuples were serialized in the order we are deserializing them in,
     // so the first occurrence of a tuple will always have a higher offset than any tuple
     // we already converted.
     for (int i = 0; i < _num_rows; ++i) {
         TupleRow* row = get_row(i);
-        std::vector<TupleDescriptor*>::const_iterator desc = tuple_descs.begin();
-        for (int j = 0; desc != tuple_descs.end(); ++desc, ++j) {
-            if ((*desc)->string_slots().empty() && (*desc)->collection_slots().empty()) {
+        for (size_t j = 0; j < tuple_descs.size(); ++j) {
+            auto desc = tuple_descs[i];

Review comment:
       ```suggestion
               auto desc = tuple_descs[j];
   ```




-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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