You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/04/25 10:25:57 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #19063: [Enhancement](alter inverted index) Improve alter inverted index performance with light weight add or drop inverted index

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


##########
be/src/olap/task/build_inverted_index.h:
##########
@@ -0,0 +1,84 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "olap/merger.h"
+#include "olap/olap_common.h"
+#include "olap/olap_define.h"
+#include "olap/rowset/segment_v2/inverted_index_desc.h"
+#include "olap/rowset/segment_v2/inverted_index_writer.h"
+#include "olap/tablet.h"
+#include "olap/tablet_meta.h"
+#include "olap/utils.h"
+#include "vec/olap/olap_data_convertor.h"
+
+namespace doris {
+
+class RowsetWriter;
+
+using RowsetWriterUniquePtr = std::unique_ptr<RowsetWriter>;
+
+class BuildInvertedIndex { 
+public:
+    BuildInvertedIndex(const TabletSharedPtr& tablet,
+                       const std::vector<TColumn>& columns,
+                       const std::vector<TOlapTableIndex> exist_indexes,
+                       const std::vector<doris::TOlapTableIndex>& alter_inverted_indexes,
+                       bool is_drop_op = false);
+    ~BuildInvertedIndex();
+
+    Status init();
+    Status do_build_inverted_index();
+    Status update_inverted_index_info();
+    Status handle_inverted_index_data();
+    Status handle_single_rowset(RowsetMetaSharedPtr output_rowset_meta,
+            std::vector<segment_v2::SegmentSharedPtr>& segments);
+    Status modify_rowsets(const Merger::Statistics* stats = nullptr);
+    void gc_output_rowset();
+
+private:
+    Status _write_inverted_index_data(int32_t segment_idx,
+                                 vectorized::Block* block);
+    Status _add_data(const std::string& column_name,
+                     const std::pair<int64_t, int64_t>& index_writer_sign, Field* field,
+                     const uint8_t** ptr, size_t num_rows);
+    Status _add_nullable(const std::string& column_name,
+                         const std::pair<int64_t, int64_t>& index_writer_sign, Field* field,
+                         const uint8_t* null_map, const uint8_t** ptr, size_t num_rows);
+
+private:

Review Comment:
   warning: redundant access specifier has the same accessibility as the previous access specifier [readability-redundant-access-specifiers]
   
   ```suggestion
   
   ```
   **be/src/olap/task/build_inverted_index.h:53:** previously declared here
   ```cpp
   private:
   ^
   ```
   



##########
be/src/olap/task/engine_alter_inverted_index_task.h:
##########
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "gen_cpp/AgentService_types.h"
+#include "olap/olap_define.h"
+#include "olap/task/engine_task.h"
+
+namespace doris {
+
+// base class for storage engine
+// add "Engine" as task prefix to prevent duplicate name with agent task
+class EngineAlterInvertedIndexTask : public EngineTask {
+public:
+    Status execute() override;
+
+public:

Review Comment:
   warning: redundant access specifier has the same accessibility as the previous access specifier [readability-redundant-access-specifiers]
   
   ```suggestion
   
   ```
   **be/src/olap/task/engine_alter_inverted_index_task.h:28:** previously declared here
   ```cpp
   public:
   ^
   ```
   



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