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

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


The following commit(s) were added to refs/heads/dev-1.1.1 by this push:
     new 9763f1d56b [cherry-pick 1.1.1][Bug] fix bug for function 
`unix_timestamp` (#11041) (#11056)
9763f1d56b is described below

commit 9763f1d56b3c5a365fb26db280c6e853b9677e53
Author: yiguolei <676222...@qq.com>
AuthorDate: Thu Jul 21 08:39:14 2022 +0800

    [cherry-pick 1.1.1][Bug] fix bug for function `unix_timestamp` (#11041) 
(#11056)
    
    * [Bug] fix bug for function `unix_timestamp`
    
    Co-authored-by: Gabriel <gabrielleeb...@gmail.com>
---
 be/src/vec/functions/function_timestamp.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/functions/function_timestamp.cpp 
b/be/src/vec/functions/function_timestamp.cpp
index 22f159bd8e..f2a7284029 100644
--- a/be/src/vec/functions/function_timestamp.cpp
+++ b/be/src/vec/functions/function_timestamp.cpp
@@ -176,7 +176,13 @@ struct UnixTimeStampImpl {
                                const ColumnNumbers& arguments, size_t result,
                                size_t input_rows_count) {
         auto col_result = ColumnVector<Int32>::create();
-        col_result->insert(context->impl()->state()->timestamp_ms() / 1000);
+        col_result->resize(input_rows_count);
+        // TODO: use a const column to store this value
+        auto& col_result_data = col_result->get_data();
+        auto res_value = context->impl()->state()->timestamp_ms() / 1000;
+        for (int i = 0; i < input_rows_count; i++) {
+            col_result_data[i] = res_value;
+        }
         block.replace_by_position(result, std::move(col_result));
         return Status::OK();
     }


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

Reply via email to