You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "mrhhsg (via GitHub)" <gi...@apache.org> on 2023/06/16 13:00:41 UTC

[GitHub] [doris] mrhhsg opened a new pull request, #20928: [improvement](serde) Optimizing the performance of mysql result writer

mrhhsg opened a new pull request, #20928:
URL: https://github.com/apache/doris/pull/20928

   ## Proposed changes
   
   When converting query results into MySQL format, it involves transforming columnar data storage into row-based storage. This process raises the question of choosing between sequential reading and sequential writing. In reality, sequential writing is the better choice for performance optimization.
   
   Test with 9M rows contains more than 20 columns, this patch can reduce the conversion time from 20s to 11s.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595795407

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595796060

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1596377559

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595650943

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595649110

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] yiguolei merged pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #20928:
URL: https://github.com/apache/doris/pull/20928


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1594640596

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233466701


##########
be/src/vec/data_types/serde/data_type_array_serde.cpp:
##########
@@ -85,47 +85,60 @@ void DataTypeArraySerDe::read_column_from_arrow(IColumn& column, const arrow::Ar
 }
 
 template <bool is_binary_format>
-Status DataTypeArraySerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
-    int buf_ret = 0;
+Status DataTypeArraySerDe::_write_column_to_mysql(const IColumn& column,
+                                                  MysqlRowBuffer<is_binary_format>& result,
+                                                  int row_idx, bool col_const) const {
     auto& column_array = assert_cast<const ColumnArray&>(column);
     auto& offsets = column_array.get_offsets();
     auto& data = column_array.get_data();
     bool is_nested_string = data.is_column_string();
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
-            return Status::InternalError("pack mysql buffer failed.");
+    const auto col_index = index_check_const(row_idx, col_const);
+    result.open_dynamic_mode();
+    if (0 != result.push_string("[", 1)) {

Review Comment:
   Why not use UNLIKELY here ? sometimes U use it , sometimes not , please keep behavior-consistency. 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1596377500

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595937598

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1596149082

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233465094


##########
be/src/vec/data_types/serde/data_type_struct_serde.cpp:
##########
@@ -56,48 +56,64 @@ void DataTypeStructSerDe::read_column_from_arrow(IColumn& column, const arrow::A
                                                  const cctz::time_zone& ctz) const {
     LOG(FATAL) << "Not support read " << column.get_name() << " from arrow";
 }
+
 template <bool is_binary_format>
-Status DataTypeStructSerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
-    int buf_ret = 0;
+Status DataTypeStructSerDe::_write_column_to_mysql(const IColumn& column,
+                                                   MysqlRowBuffer<is_binary_format>& result,
+                                                   int row_idx, bool col_const) const {
     auto& col = assert_cast<const ColumnStruct&>(column);
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
-            return Status::InternalError("pack mysql buffer failed.");
-        }
-        const auto col_index = index_check_const(i, col_const);
-        result[row_idx].open_dynamic_mode();
-        buf_ret = result[row_idx].push_string("{", 1);
-        bool begin = true;
-        for (size_t j = 0; j < elemSerDeSPtrs.size(); ++j) {
-            if (!begin) {
-                buf_ret = result[row_idx].push_string(", ", 2);
+    const auto col_index = index_check_const(row_idx, col_const);
+    result.open_dynamic_mode();
+    if (0 != result.push_string("{", 1)) {

Review Comment:
   UNLIKELY If 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233010896


##########
be/src/vec/data_types/serde/data_type_hll_serde.cpp:
##########
@@ -102,30 +102,38 @@ void DataTypeHLLSerDe::write_column_to_arrow(const IColumn& column, const UInt8*
 }
 
 template <bool is_binary_format>
-Status DataTypeHLLSerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
+Status DataTypeHLLSerDe::_write_column_to_mysql(const IColumn& column,
+                                                MysqlRowBuffer<is_binary_format>& result,
+                                                int row_idx, bool col_const) const {
     auto& data_column = assert_cast<const ColumnHLL&>(column);
-    int buf_ret = 0;
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
+    if constexpr (is_binary_format) {

Review Comment:
   is_binary_format can not present return_object_data_as_binary  , just because we have a switch return_object_data_as_binary,  so there is a situation with return_object_data_as_binary=true , but is_binary_format is false. 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595938205

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233466701


##########
be/src/vec/data_types/serde/data_type_array_serde.cpp:
##########
@@ -85,47 +85,60 @@ void DataTypeArraySerDe::read_column_from_arrow(IColumn& column, const arrow::Ar
 }
 
 template <bool is_binary_format>
-Status DataTypeArraySerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
-    int buf_ret = 0;
+Status DataTypeArraySerDe::_write_column_to_mysql(const IColumn& column,
+                                                  MysqlRowBuffer<is_binary_format>& result,
+                                                  int row_idx, bool col_const) const {
     auto& column_array = assert_cast<const ColumnArray&>(column);
     auto& offsets = column_array.get_offsets();
     auto& data = column_array.get_data();
     bool is_nested_string = data.is_column_string();
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
-            return Status::InternalError("pack mysql buffer failed.");
+    const auto col_index = index_check_const(row_idx, col_const);
+    result.open_dynamic_mode();
+    if (0 != result.push_string("[", 1)) {

Review Comment:
   Why not use UNLIKELY here ? sometimes U use it , sometimes not , please keep behavior-consistency. 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1596426559

   LGTM


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595592467

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1594655446

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1594936086

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1595593615

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1596147060

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] amorynan commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233465094


##########
be/src/vec/data_types/serde/data_type_struct_serde.cpp:
##########
@@ -56,48 +56,64 @@ void DataTypeStructSerDe::read_column_from_arrow(IColumn& column, const arrow::A
                                                  const cctz::time_zone& ctz) const {
     LOG(FATAL) << "Not support read " << column.get_name() << " from arrow";
 }
+
 template <bool is_binary_format>
-Status DataTypeStructSerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
-    int buf_ret = 0;
+Status DataTypeStructSerDe::_write_column_to_mysql(const IColumn& column,
+                                                   MysqlRowBuffer<is_binary_format>& result,
+                                                   int row_idx, bool col_const) const {
     auto& col = assert_cast<const ColumnStruct&>(column);
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
-            return Status::InternalError("pack mysql buffer failed.");
-        }
-        const auto col_index = index_check_const(i, col_const);
-        result[row_idx].open_dynamic_mode();
-        buf_ret = result[row_idx].push_string("{", 1);
-        bool begin = true;
-        for (size_t j = 0; j < elemSerDeSPtrs.size(); ++j) {
-            if (!begin) {
-                buf_ret = result[row_idx].push_string(", ", 2);
+    const auto col_index = index_check_const(row_idx, col_const);
+    result.open_dynamic_mode();
+    if (0 != result.push_string("{", 1)) {

Review Comment:
   UNLIKELY If 



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] mrhhsg commented on a diff in pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on code in PR #20928:
URL: https://github.com/apache/doris/pull/20928#discussion_r1233085735


##########
be/src/vec/data_types/serde/data_type_hll_serde.cpp:
##########
@@ -102,30 +102,38 @@ void DataTypeHLLSerDe::write_column_to_arrow(const IColumn& column, const UInt8*
 }
 
 template <bool is_binary_format>
-Status DataTypeHLLSerDe::_write_column_to_mysql(
-        const IColumn& column, bool return_object_data_as_binary,
-        std::vector<MysqlRowBuffer<is_binary_format>>& result, int row_idx, int start, int end,
-        bool col_const) const {
+Status DataTypeHLLSerDe::_write_column_to_mysql(const IColumn& column,
+                                                MysqlRowBuffer<is_binary_format>& result,
+                                                int row_idx, bool col_const) const {
     auto& data_column = assert_cast<const ColumnHLL&>(column);
-    int buf_ret = 0;
-    for (ssize_t i = start; i < end; ++i) {
-        if (0 != buf_ret) {
+    if constexpr (is_binary_format) {

Review Comment:
   Yes, thanks for your comment.



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [doris] github-actions[bot] commented on pull request #20928: [improvement](serde) Optimizing the performance of mysql result writer

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20928:
URL: https://github.com/apache/doris/pull/20928#issuecomment-1594942593

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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