xiaokang commented on code in PR #25669:
URL: https://github.com/apache/doris/pull/25669#discussion_r1366585254


##########
be/src/vec/columns/column_array.cpp:
##########
@@ -422,7 +422,8 @@ void ColumnArray::reserve(size_t n) {
 
 //please check you real need size in data column, because it's maybe need 
greater size when data is string column
 void ColumnArray::resize(size_t n) {
-    get_offsets().resize(n);
+    auto last_off = get_offsets().back();
+    get_offsets().resize_fill(n, last_off);

Review Comment:
   We need to check if resize_fill will modify old offsets value.



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -422,7 +422,8 @@ void ColumnArray::reserve(size_t n) {
 
 //please check you real need size in data column, because it's maybe need 
greater size when data is string column
 void ColumnArray::resize(size_t n) {

Review Comment:
   Is there the same problem for ColumnStruct?



##########
be/src/vec/columns/column_map.cpp:
##########
@@ -450,7 +450,8 @@ void ColumnMap::reserve(size_t n) {
 }
 
 void ColumnMap::resize(size_t n) {
-    get_offsets().resize(n);
+    auto last_off = get_offsets().back();
+    get_offsets().resize_fill(n, last_off);
     keys_column->resize(n);

Review Comment:
   should not call resize on keys and values column



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -422,7 +422,8 @@ void ColumnArray::reserve(size_t n) {
 
 //please check you real need size in data column, because it's maybe need 
greater size when data is string column
 void ColumnArray::resize(size_t n) {
-    get_offsets().resize(n);
+    auto last_off = get_offsets().back();
+    get_offsets().resize_fill(n, last_off);
     get_data().resize(n);

Review Comment:
   I think it should not call get_data().resize(n). Just append offsets with 
the same value.



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