imay commented on a change in pull request #2310: Marising
URL: https://github.com/apache/incubator-doris/pull/2310#discussion_r351166594
 
 

 ##########
 File path: be/src/olap/types.h
 ##########
 @@ -427,6 +451,25 @@ struct FieldTypeTraits<OLAP_FIELD_TYPE_DATE> : public 
BaseFieldtypeTraits<OLAP_F
         strftime(buf, sizeof(buf), "%Y-%m-%d", &time_tm);
         return std::string(buf);
     }
+    static OLAPStatus convert_from(void* dest, const void* src, const 
TypeInfo* src_type, MemPool* mem_pool) {
+        //only support datetime now
+        if(src_type->type() == FieldType::OLAP_FIELD_TYPE_DATETIME){
+            using SrcType = typename 
CppTypeTraits<OLAP_FIELD_TYPE_DATETIME>::CppType;
+            SrcType src_value = *reinterpret_cast<const SrcType*>(src);
+            SrcType part1 = (src_value / 1000000L);
+            tm time_tm;
 
 Review comment:
   It seems that `time_tm` is unnecessary.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to