yiguolei commented on code in PR #69070:
URL: https://github.com/apache/doris/pull/69070#discussion_r4312575162


##########
be/src/storage/segment/array_index_input.cpp:
##########
@@ -0,0 +1,63 @@
+// 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.
+
+#include "storage/segment/array_index_input.h"
+
+#include "common/cast_set.h"
+#include "core/column/column_nullable.h"
+#include "storage/index/index_writer.h"
+#include "storage/storage_layout.h"
+
+namespace doris::segment_v2 {
+
+size_t rebase_offsets(const IColumn::Offsets64& offsets, size_t row_pos, 
size_t num_rows,
+                      uint64_t base, ColumnOffset64* out) {
+    // Row i starts at offsets[i - 1]; offsets[-1] is 0 by the array's padding.
+    const auto start_of = [&](size_t row) {
+        return offsets[cast_set<ssize_t, size_t, false>(row) - 1];
+    };
+    const uint64_t first = start_of(row_pos);
+    auto& data = out->get_data();
+    data.clear();
+    data.reserve(num_rows + 1);
+    for (size_t i = 0; i <= num_rows; ++i) {
+        data.push_back(start_of(row_pos + i) - first + base);
+    }
+    return data.back() - base;
+}
+
+ColumnPtr char_items_to_storage(const IColumn& items, size_t length) {

Review Comment:
   move to storage layout



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