HappenLee commented on code in PR #55651:
URL: https://github.com/apache/doris/pull/55651#discussion_r2324066579


##########
be/src/vec/columns/column_varbinary.cpp:
##########
@@ -0,0 +1,185 @@
+// 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 "vec/columns/column_varbinary.h"
+
+#include <glog/logging.h>
+
+#include <cstddef>
+
+#include "runtime/primitive_type.h"
+#include "vec/columns/column.h"
+#include "vec/columns/column_string.h"
+#include "vec/columns/columns_common.h"
+#include "vec/common/assert_cast.h"
+
+namespace doris::vectorized {
+#include "common/compile_check_begin.h"
+MutableColumnPtr ColumnVarbinary::clone_resized(size_t size) const {
+    auto res = create();
+    if (size > 0) {
+        auto& new_col = assert_cast<Self&>(*res);
+        size_t count = std::min(this->size(), size);
+        for (size_t i = 0; i < count; ++i) {
+            auto value = this->get_data_at(i);
+            new_col.insert_data(value.data, value.size);
+        }
+    }
+    return res;
+}
+
+void ColumnVarbinary::insert_range_from(const IColumn& src, size_t start, 
size_t length) {
+    const auto& src_col = assert_cast<const ColumnVarbinary&>(src);
+    if (length == 0) {

Review Comment:
   judge length before assert_cast
   



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