You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Gabriel39 (via GitHub)" <gi...@apache.org> on 2023/06/09 08:24:45 UTC

[GitHub] [doris] Gabriel39 commented on a diff in pull request #20247: [feature](datetime) "timediff" supports calculating microseconds.

Gabriel39 commented on code in PR #20247:
URL: https://github.com/apache/doris/pull/20247#discussion_r1224000165


##########
be/src/vec/data_types/data_type_time.h:
##########
@@ -69,6 +69,34 @@ class DataTypeTime final : public DataTypeNumberBase<Float64> {
 
     DataTypeSerDeSPtr get_serde() const override { return std::make_shared<DataTypeTimeSerDe>(); };
     TypeIndex get_type_id() const override { return TypeIndex::Time; }
+    const char* get_family_name() const override { return "time"; }
 };
 
+class DataTypeTimeV2 : public DataTypeNumberBase<Float64> {

Review Comment:
   need to implement `to_pb_column_meta`



##########
gensrc/script/doris_builtins_functions.py:
##########
@@ -1048,13 +1048,13 @@
         [['timediff'], 'TIMEV2', ['DATETIMEV2', 'DATETIMEV2'], ''],
 
         [['datediff'], 'INT', ['DATETIMEV2', 'DATEV2'], ''],
-        [['timediff'], 'TIMEV2', ['DATETIMEV2', 'DATEV2'], ''],

Review Comment:
   why make this change?



##########
be/src/vec/data_types/data_type_time.h:
##########
@@ -69,6 +69,34 @@ class DataTypeTime final : public DataTypeNumberBase<Float64> {
 
     DataTypeSerDeSPtr get_serde() const override { return std::make_shared<DataTypeTimeSerDe>(); };
     TypeIndex get_type_id() const override { return TypeIndex::Time; }
+    const char* get_family_name() const override { return "time"; }
 };
 
+class DataTypeTimeV2 : public DataTypeNumberBase<Float64> {

Review Comment:
   also need to hold a `scale` inside this type



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

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


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