HappenLee commented on code in PR #23902:
URL: https://github.com/apache/doris/pull/23902#discussion_r1316663927


##########
be/src/vec/functions/function_date_or_datetime_computation.h:
##########
@@ -1104,6 +1104,62 @@ struct SecToTimeImpl {
         return Status::OK();
     }
 };
+struct MicroSec {
+    static constexpr auto name = "from_microsecond";
+    static constexpr Int64 ratio = 1000000;
+};
+struct MilliSec {
+    static constexpr auto name = "from_millisecond";
+    static constexpr Int64 ratio = 1000;
+};
+struct Sec {
+    static constexpr auto name = "from_second";
+    static constexpr Int64 ratio = 1;
+};
+template <typename impl>
+struct TimestampToDateTime : IFunction {
+    using ReturnType = DataTypeDateTimeV2;
+    static constexpr auto name = impl::name;
+    static constexpr Int64 ratio_to_micro = (1000 * 1000) / impl::ratio;
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 0; }
+
+    DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) 
const override {
+        return make_nullable(std::make_shared<ReturnType>());
+    }
+
+    static FunctionPtr create() { return 
std::make_shared<TimestampToDateTime<impl>>(); }
+
+    bool is_variadic() const override { return true; }
+
+    Status execute_impl(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,
+                        size_t result, size_t input_rows_count) override {
+        return execute(context, block, arguments, result, input_rows_count);

Review Comment:
   no need call another function



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to