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

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


The following commit(s) were added to refs/heads/master by this push:
     new 619f2bbbda8 [Fix](thrift api) column should be converted if const 
before serialize to arrow format (#26111)
619f2bbbda8 is described below

commit 619f2bbbda8e5c95ae9550798cb9f0a1997a8563
Author: lihangyu <[email protected]>
AuthorDate: Mon Oct 30 19:56:19 2023 +0800

    [Fix](thrift api) column should be converted if const before serialize to 
arrow format (#26111)
    
    ```
    select null;
    ```
    
    The above sql from thrift api will cause crash in `write_column_to_arrow` 
since it's column const,
    we should convert to full column
---
 be/src/util/arrow/block_convertor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/be/src/util/arrow/block_convertor.cpp 
b/be/src/util/arrow/block_convertor.cpp
index 7f506d03111..2c605c9c968 100644
--- a/be/src/util/arrow/block_convertor.cpp
+++ b/be/src/util/arrow/block_convertor.cpp
@@ -388,8 +388,9 @@ Status 
FromBlockConverter::convert(std::shared_ptr<arrow::RecordBatch>* out) {
             return to_doris_status(arrow_st);
         }
         _cur_builder = builder.get();
+        auto column = _cur_col->convert_to_full_column_if_const();
         try {
-            _cur_type->get_serde()->write_column_to_arrow(*_cur_col, nullptr, 
_cur_builder,
+            _cur_type->get_serde()->write_column_to_arrow(*column, nullptr, 
_cur_builder,
                                                           _cur_start, 
_cur_start + _cur_rows);
         } catch (std::exception& e) {
             return Status::InternalError("Fail to convert block data to arrow 
data, error: {}",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to