github-actions[bot] commented on code in PR #68257:
URL: https://github.com/apache/doris/pull/68257#discussion_r4056630833


##########
be/src/core/data_type_serde/data_type_datetimev2_serde.cpp:
##########
@@ -683,7 +689,13 @@ Status 
DataTypeDateTimeV2SerDe::read_column_from_arrow(IColumn& column,
             // "2022-01-01 11:11:11.111", timestamp = 1641035471111, divisor = 
1000,
             // set_microsecond(111000)
             v.set_microsecond(remainder * DIVISOR_FOR_MICRO / divisor);
-            col_data.emplace_back(v);
+            DateV2Value<DateTimeV2ValueType> scaled_v;
+            if (!transform_date_scale(_scale, 6, scaled_v, v)) {

Review Comment:
   [P1] Roll back partial column state when rounding fails
   
   `transform_date_scale` can now return `DataQualityError` after earlier rows 
have already been appended. For example, a valid `timestamp[us]` batch `[0, 
253402300799999500]` into `DATETIMEV2(3)` appends row 0, then the max-date row 
rounds to `10000-01-01` and returns here, leaving the caller's column one row 
short. With `DataTypeNullableSerDe`, the wrapper has already appended the full 
null map before this nested call, so the nested column and null map have 
different lengths and `ColumnNullable::sanity_check()`/later reuse can fail. 
Persistent Arrow/ADBC block readers and the standalone column helper retain 
this mutated column on error. Capture and restore the pre-call nested/null-map 
sizes (or decode transactionally) on every failure, and add a regression test 
for a mixed valid/overflow batch.



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