jacktengg commented on code in PR #66333:
URL: https://github.com/apache/doris/pull/66333#discussion_r3713639476


##########
be/src/core/data_type/data_type_date_or_datetime_v2.h:
##########
@@ -154,10 +160,56 @@ class DataTypeDateTimeV2 final : public 
DataTypeNumberBase<PrimitiveType::TYPE_D
     UInt32 _scale;
 };
 
+class DataTypeDateTimeV2Nano final
+        : public DataTypeNumberBase<PrimitiveType::TYPE_DATETIMEV2_NANO> {
+public:
+    static constexpr PrimitiveType PType = TYPE_DATETIMEV2_NANO;
+    static constexpr bool is_parametric = true;
+
+    explicit DataTypeDateTimeV2Nano(UInt32 scale = 9) : _scale(scale) {
+        DORIS_CHECK_GE(scale, 7);
+        DORIS_CHECK_LE(scale, 9);
+    }
+
+    PrimitiveType get_primitive_type() const override { return 
TYPE_DATETIMEV2_NANO; }
+    doris::FieldType get_storage_field_type() const override {
+        return doris::FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO;
+    }
+    void to_protobuf(PTypeDesc* ptype, PTypeNode* node, PScalarType* 
scalar_type) const override {
+        scalar_type->set_scale(_scale);
+    }
+
+    const std::string get_family_name() const override { return 
"DateTimeV2Nano"; }

Review Comment:
   Complete function support for DateTimeV2Nano will be in following PRs, this 
PR does not implement because implement all the functions in one single PR is 
hard for reviewers.



-- 
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