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


##########
be/src/vec/data_types/serde/data_type_number_serde.cpp:
##########
@@ -239,6 +239,72 @@ Status DataTypeNumberSerDe<T>::write_column_to_mysql(const 
IColumn& column,
     return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
 }
 
+template <typename T>
+Status DataTypeNumberSerDe<T>::write_column_to_orc(const IColumn& column, 
const NullMap* null_map,
+                                                   orc::ColumnVectorBatch* 
orc_col_batch, int start,
+                                                   int end,
+                                                   std::vector<StringRef>& 
buffer_list) const {
+    auto& col_data = assert_cast<const ColumnType&>(column).get_data();
+
+    if constexpr (std::is_same_v<T, Int128>) {
+        orc::StringVectorBatch* cur_batch = 
dynamic_cast<orc::StringVectorBatch*>(orc_col_batch);
+
+        char* ptr = (char*)malloc(BUFFER_UNIT_SIZE);
+        if (!ptr) {
+            return Status::InternalError(
+                    "malloc memory error when write largeint column data to 
orc file.");
+        }
+        StringRef bufferRef;
+        bufferRef.data = ptr;
+        bufferRef.size = BUFFER_UNIT_SIZE;
+        size_t offset = 0;
+        const size_t begin_off = offset;
+
+        for (size_t row_id = start; row_id < end; row_id++) {
+            if (cur_batch->notNull[row_id] == 0) {
+                continue;
+            }
+            std::string value_str = fmt::format("{}", col_data[row_id]);
+            size_t len = value_str.size();

Review Comment:
   warning: variable 'value_str' is not initialized 
[cppcoreguidelines-init-variables]
   
   be/src/vec/data_types/serde/data_type_number_serde.cpp:269:
   ```diff
   - tr = fmt::format("{}", col_data[row_id]);
   + tr = 0 = fmt::format("{}", col_data[row_id]);
   ```
   



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