You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by li...@apache.org on 2022/06/09 07:15:31 UTC

[incubator-doris] branch master updated: [feature-wip](array-type) support array in mysql_result_writer (#9998)

This is an automated email from the ASF dual-hosted git repository.

lihaopeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new dc874709d7 [feature-wip](array-type) support array<decimal128> in mysql_result_writer (#9998)
dc874709d7 is described below

commit dc874709d78809ed192e0d4e34b77c263bd2f00d
Author: yinzhijian <37...@qq.com>
AuthorDate: Thu Jun 9 15:15:26 2022 +0800

    [feature-wip](array-type) support array<decimal128> in mysql_result_writer (#9998)
---
 be/src/vec/sink/mysql_result_writer.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/be/src/vec/sink/mysql_result_writer.cpp b/be/src/vec/sink/mysql_result_writer.cpp
index 489b70ed8c..55fa8aaf41 100644
--- a/be/src/vec/sink/mysql_result_writer.cpp
+++ b/be/src/vec/sink/mysql_result_writer.cpp
@@ -283,6 +283,12 @@ int VMysqlResultWriter::_add_one_cell(const ColumnPtr& column_ptr, size_t row_id
         char buf[64];
         char* pos = datetime.to_string(buf);
         return buffer.push_string(buf, pos - buf - 1);
+    } else if (which.is_decimal128()) {
+        auto& column_data =
+                static_cast<const ColumnDecimal<vectorized::Decimal128>&>(*column).get_data();
+        DecimalV2Value decimal_val(column_data[row_idx]);
+        auto decimal_str = decimal_val.to_string();
+        return buffer.push_string(decimal_str.c_str(), decimal_str.length());
     } else if (which.is_array()) {
         auto& column_array = assert_cast<const ColumnArray&>(*column);
         auto& offsets = column_array.get_offsets();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org