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


##########
be/src/core/field.cpp:
##########
@@ -90,6 +90,34 @@ bool decimal_less_or_equal(Decimal128V3 x, Decimal128V3 y, 
UInt32 xs, UInt32 ys)
     return dec_less_or_equal<TYPE_DECIMAL128I>(x, y, xs, ys);
 }
 
+namespace {
+// Fields outlive decoder pages and source columns (for example, zone-map 
bounds).
+// Keep the view first for Field::get(), and fit ownership into the existing 
Field storage.
+struct OwnedBinaryField {
+    StringView view;
+    char* bytes = nullptr;
+
+    explicit OwnedBinaryField(const StringView& value) : view(value) {
+        if (!value.isInline()) {

Review Comment:
   这个代码写的太复杂了。
   实际:
   1. 我们always 会copy 一遍的
   2. 让string view 指向 我们内部的bytes 数组。
   你只要把函数初始化列表里的view 赋值删掉就行了



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