dataroaring commented on code in PR #24964:
URL: https://github.com/apache/doris/pull/24964#discussion_r1369661059


##########
be/src/vec/columns/column_string.h:
##########
@@ -152,11 +152,36 @@ class ColumnString final : public COWHelper<IColumn, 
ColumnString> {
         offsets.push_back(new_size);
     }
 
+    void check_offset(const ColumnString& src, size_t n) {
+        if (UNLIKELY(src.offsets.get_begin_ptr() > src.offsets.get_end_ptr())) 
{
+            throw doris::Exception(ErrorCode::IO_ERROR,
+                                   "ColumnString={} has wrong offset, "
+                                   "row_number={},src.offsets 
start={},src.offsets end={}",
+                                   src.get_name(), n, 
src.offsets.get_begin_ptr(),
+                                   src.offsets.get_end_ptr());
+        }
+        if (UNLIKELY(n >= src.offsets.size())) {
+            throw doris::Exception(ErrorCode::IO_ERROR,

Review Comment:
   WE can not return IO_ERROR here, we should return WRONG_DATA or something 
else.



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