Copilot commented on code in PR #62179:
URL: https://github.com/apache/doris/pull/62179#discussion_r3084934242


##########
be/src/format/column_type_convert.h:
##########
@@ -560,22 +584,23 @@ class CastStringConverter : public ColumnTypeConverter {
         size_t start_idx = to_col->size();
         to_col->resize(start_idx + rows);
         auto& data = assert_cast<DstColumnType*>(to_col.get())->get_data();
+        CastParameters params;
         for (int i = 0; i < rows; ++i) {
             bool can_cast = false;
             if constexpr (is_decimal_type<DstPrimitiveType>()) {
                 can_cast = 
SafeCastDecimalString<DstPrimitiveType>::safe_cast_string(
                         string_col->get_data_at(i), &data[start_idx + i],
-                        _dst_type_desc->get_precision(), 
_dst_type_desc->get_scale());
+                        _dst_type_desc->get_precision(), 
_dst_type_desc->get_scale(), params);
             } else if constexpr (DstPrimitiveType == TYPE_DATETIMEV2) {
                 can_cast = SafeCastString<TYPE_DATETIMEV2>::safe_cast_string(
                         string_col->get_data_at(i), &data[start_idx + i],
-                        _dst_type_desc->get_scale());
+                        _dst_type_desc->get_scale(), params);
             } else if constexpr (DstPrimitiveType == TYPE_BOOLEAN && 
fileFormat == ORC) {
                 can_cast = SafeCastString<TYPE_BOOLEAN, ORC>::safe_cast_string(
-                        string_col->get_data_at(i), &data[start_idx + i]);
+                        string_col->get_data_at(i), &data[start_idx + i], 
params);
             } else {
                 can_cast = SafeCastString<DstPrimitiveType>::safe_cast_string(
-                        string_col->get_data_at(i), &data[start_idx + i]);
+                        string_col->get_data_at(i), &data[start_idx + i], 
params);

Review Comment:
   `CastStringConverter` is templated on `fileFormat`, and `SafeCastString` 
specializations depend on the `FileFormat` template arg (e.g. float/double 
treat NaN as null for ORC). The current calls use 
`SafeCastString<DstPrimitiveType>` / `SafeCastString<TYPE_DATETIMEV2>` which 
instantiates with the default `COMMON` format, so ORC-specific behavior won’t 
be applied for most destination types. Use `SafeCastString<..., fileFormat>` 
(and for datetimev2, `SafeCastString<TYPE_DATETIMEV2, fileFormat>`) so the 
correct format-specific specialization is selected.



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