eldenmoon commented on code in PR #48062:
URL: https://github.com/apache/doris/pull/48062#discussion_r1961403828


##########
be/src/olap/rowset/segment_v2/segment.h:
##########
@@ -275,6 +275,8 @@ class Segment : public 
std::enable_shared_from_this<Segment>, public MetadataAdd
     DorisCallOnce<Status> _inverted_index_file_reader_open;
 
     InvertedIndexFileInfo _idx_file_info;
+    std::map<std::pair<int64_t, std::string>, std::unique_ptr<TabletIndex>>

Review Comment:
   这个的作用是?



##########
be/src/olap/rowset/segment_v2/variant_column_writer_impl.h:
##########
@@ -98,6 +98,8 @@ class VariantColumnWriterImpl {
 
     // staticstics which will be persisted in the footer
     VariantStatistics _statistics;
+
+    std::vector<std::unique_ptr<TabletIndex>> _subcolumns_indexes;

Review Comment:
   only expand life cycle?



##########
be/src/olap/rowset/segment_v2/segment.h:
##########
@@ -275,6 +275,8 @@ class Segment : public 
std::enable_shared_from_this<Segment>, public MetadataAdd
     DorisCallOnce<Status> _inverted_index_file_reader_open;
 
     InvertedIndexFileInfo _idx_file_info;
+    std::map<std::pair<int64_t, std::string>, std::unique_ptr<TabletIndex>>

Review Comment:
   why put in segment.h



##########
regression-test/suites/variant_p0/update/inverted_index/load.groovy:
##########
@@ -0,0 +1,77 @@
+// 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.
+
+suite("update_test_index_load", "p0") {
+
+    def load_json_data = {table_name, file_name ->
+        // load the json data
+        streamLoad {
+            table "${table_name}"
+
+            // set http request header params
+            set 'read_json_by_line', 'true' 
+            set 'format', 'json' 
+            set 'max_filter_ratio', '0.1'
+            set 'memtable_on_sink_node', 'true'
+            file file_name // import json file
+            time 10000 // limit inflight 10s
+
+            // if declared a check callback, the default check condition will 
ignore.
+            // So you must check all condition
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                        throw exception
+                }
+                logger.info("Stream load ${file_name} result: 
${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0)
+            }
+        }
+    }
+
+
+    def create_table_load_data = {create_table_name->
+        sql "DROP TABLE IF EXISTS ${create_table_name}"
+        sql """
+            CREATE TABLE IF NOT EXISTS ${create_table_name} (
+                k bigint,
+                v variant NOT NULL,
+                INDEX idx(v) USING INVERTED PROPERTIES("parser"="standard")

Review Comment:
   test v1 and v2



##########
be/src/olap/rowset/segment_v2/variant_column_writer_impl.h:
##########
@@ -98,6 +98,8 @@ class VariantColumnWriterImpl {
 
     // staticstics which will be persisted in the footer
     VariantStatistics _statistics;
+
+    std::vector<std::unique_ptr<TabletIndex>> _subcolumns_indexes;

Review Comment:
   useless?



##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -216,6 +216,9 @@ Status 
VerticalSegmentWriter::_create_column_writer(uint32_t cid, const TabletCo
         DCHECK(_inverted_index_file_writer != nullptr);
         opts.inverted_index_file_writer = _inverted_index_file_writer;
         // TODO support multiple inverted index
+    } else if (tablet_schema->has_inverted_index() && 
column.is_variant_type()) {
+        DCHECK(_inverted_index_file_writer != nullptr);

Review Comment:
   没看懂这个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