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


##########
be/src/vec/data_types/data_type_array.cpp:
##########
@@ -110,12 +113,14 @@ void get_decimal_value(const IColumn& nested_column, 
DecimalV2Value& decimal_val
     decimal_value = (DecimalV2Value)(reinterpret_cast<const PackedInt128*>(
                                              nested_col->get_data_at(pos).data)
                                              ->value);
-    return;
 }
 
 void DataTypeArray::to_string(const IColumn& column, size_t row_num, 
BufferWritable& ostr) const {
-    auto ptr = column.convert_to_full_column_if_const();
-    auto& data_column = assert_cast<const ColumnArray&>(*ptr.get());
+    auto result = check_column_const_set_readability(column, row_num);
+    ColumnPtr ptr = result.first;
+    row_num = result.second;
+
+    auto& data_column = assert_cast<const ColumnArray&>(*ptr);
     auto& offsets = data_column.get_offsets();
 
     size_t offset = offsets[row_num - 1];

Review Comment:
   row_num is `size_t`  is danger to do `row_num - 1` recheck the logic



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