Mryange commented on code in PR #36110:
URL: https://github.com/apache/doris/pull/36110#discussion_r1634517843


##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -702,7 +702,7 @@ struct UnixTimeStampStrImpl {
         std::tie(col_right, format_const) =
                 unpack_if_const(block.get_by_position(arguments[1]).column);
 
-        auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 
0);
+        auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 
6);

Review Comment:
   Since the return type is fixed,
   static DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& 
arguments) {
       return make_nullable(std::make_shared<DataTypeDecimal<Decimal64>>(16, 
6));
   }



##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -702,7 +702,7 @@ struct UnixTimeStampStrImpl {
         std::tie(col_right, format_const) =
                 unpack_if_const(block.get_by_position(arguments[1]).column);
 
-        auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 
0);
+        auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 
6);

Review Comment:
   > why not using scale from planner? like 
`block.get_by_position(result).type->get_scale()`
   
   Since the return type is fixed,
   static DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& 
arguments) {
       return make_nullable(std::make_shared<DataTypeDecimal<Decimal64>>(16, 
6));
   }



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

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


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

Reply via email to