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

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 790e3207c6d branch-4.1: [fix](exec) Return Thrift DATETIME as naive 
Arrow timestamp #67232 (#67299)
790e3207c6d is described below

commit 790e3207c6d1b9bdc013cafcc66482f31ccb06ba
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Aug 29 17:52:22 2026 +0800

    branch-4.1: [fix](exec) Return Thrift DATETIME as naive Arrow timestamp 
#67232 (#67299)
    
    Cherry-picked from #67232
    
    Co-authored-by: Mryange <[email protected]>
---
 be/src/exec/operator/memory_scratch_sink_operator.cpp | 3 ++-
 be/src/format/arrow/arrow_row_batch.cpp               | 5 +++--
 be/src/format/arrow/arrow_row_batch.h                 | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/be/src/exec/operator/memory_scratch_sink_operator.cpp 
b/be/src/exec/operator/memory_scratch_sink_operator.cpp
index 3492b9774ee..916abc461c7 100644
--- a/be/src/exec/operator/memory_scratch_sink_operator.cpp
+++ b/be/src/exec/operator/memory_scratch_sink_operator.cpp
@@ -107,7 +107,8 @@ Status MemoryScratchSinkOperatorX::sink_impl(RuntimeState* 
state, Block* input_b
     {
         SCOPED_TIMER(local_state._get_arrow_schema_timer);
         // After expr executed, use recaculated schema as final schema
-        RETURN_IF_ERROR(get_arrow_schema_from_block(block, 
&block_arrow_schema, state->timezone()));
+        RETURN_IF_ERROR(get_arrow_schema_from_block(block, 
&block_arrow_schema, state->timezone(),
+                                                    /*datetime_naive=*/true));
     }
     {
         SCOPED_TIMER(local_state._convert_block_to_arrow_batch_timer);
diff --git a/be/src/format/arrow/arrow_row_batch.cpp 
b/be/src/format/arrow/arrow_row_batch.cpp
index 4f80fb042ea..cc88bc18b92 100644
--- a/be/src/format/arrow/arrow_row_batch.cpp
+++ b/be/src/format/arrow/arrow_row_batch.cpp
@@ -203,11 +203,12 @@ std::shared_ptr<arrow::Field> 
create_arrow_field_with_metadata(
 }
 
 Status get_arrow_schema_from_block(const Block& block, 
std::shared_ptr<arrow::Schema>* result,
-                                   const std::string& timezone) {
+                                   const std::string& timezone, bool 
datetime_naive) {
     std::vector<std::shared_ptr<arrow::Field>> fields;
     for (const auto& type_and_name : block) {
         std::shared_ptr<arrow::DataType> arrow_type;
-        RETURN_IF_ERROR(convert_to_arrow_type(type_and_name.type, &arrow_type, 
timezone));
+        RETURN_IF_ERROR(
+                convert_to_arrow_type(type_and_name.type, &arrow_type, 
timezone, datetime_naive));
         auto field = create_arrow_field_with_metadata(type_and_name.name, 
arrow_type,
                                                       
type_and_name.type->is_nullable(),
                                                       
type_and_name.type->get_primitive_type());
diff --git a/be/src/format/arrow/arrow_row_batch.h 
b/be/src/format/arrow/arrow_row_batch.h
index e5ddd18fae6..d5ba5cb0ed0 100644
--- a/be/src/format/arrow/arrow_row_batch.h
+++ b/be/src/format/arrow/arrow_row_batch.h
@@ -54,7 +54,7 @@ std::shared_ptr<arrow::Field> 
create_arrow_field_with_metadata(
         bool is_nullable, PrimitiveType primitive_type);
 
 Status get_arrow_schema_from_block(const Block& block, 
std::shared_ptr<arrow::Schema>* result,
-                                   const std::string& timezone);
+                                   const std::string& timezone, bool 
datetime_naive = false);
 
 Status get_arrow_schema_from_expr_ctxs(const VExprContextSPtrs& 
output_vexpr_ctxs,
                                        std::shared_ptr<arrow::Schema>* result,


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

Reply via email to