xiaokang commented on code in PR #38371:
URL: https://github.com/apache/doris/pull/38371#discussion_r1694234157


##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -137,10 +137,15 @@ SegmentWriter::SegmentWriter(io::FileWriter* file_writer, 
uint32_t segment_id,
         }
     }
     if (_tablet_schema->has_inverted_index()) {
+        std::string segment_file_path = file_writer->path().c_str();
+        // if file_writer is a StreamSinkFileWriter, path is empty
+        if (segment_file_path.empty()) {
+            segment_file_path = _opts.rowset_ctx->segment_path(segment_id);
+        }
         _inverted_index_file_writer = 
std::make_unique<InvertedIndexFileWriter>(
                 _opts.rowset_ctx->fs(),
-                std::string 
{InvertedIndexDescriptor::get_index_file_path_prefix(
-                        file_writer->path().c_str())},
+                std::string {
+                        
InvertedIndexDescriptor::get_index_file_path_prefix(segment_file_path)},

Review Comment:
   why change it?



##########
be/src/vec/olap/block_reader.h:
##########
@@ -97,6 +97,10 @@ class BlockReader final : public TabletReader {
     std::vector<int> _normal_columns_idx; // key column on agg mode, all 
column on uniq mode
     std::vector<int> _agg_columns_idx;
     std::vector<int> _return_columns_loc;
+    // before reading the segment, some expressions will compute results 
through the index to generate result columns
+    // retain this result column when calculating the agg value
+    int _index_result_columns = 0;

Review Comment:
   It seems to be not safe.



##########
be/src/vec/olap/block_reader.cpp:
##########
@@ -233,7 +233,9 @@ Status BlockReader::init(const ReaderParams& read_params) {
         }
         return status;
     }
-
+    if (size_t cols = _next_row.block->columns() - _return_columns_loc.size() 
> 0; cols > 0) {

Review Comment:
   It not a common style to write multiple statements in if.



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