This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 67fb00de80c branch-3.0: [fix](type) Fix TYPE_DATETIMEV2 upgrade and 
downgrade compatibility (#52533)
67fb00de80c is described below

commit 67fb00de80cee23c3ae4bb06d810416ffd24abae
Author: Xinyi Zou <[email protected]>
AuthorDate: Mon Jul 7 14:35:58 2025 +0800

    branch-3.0: [fix](type) Fix TYPE_DATETIMEV2 upgrade and downgrade 
compatibility (#52533)
    
    Introduced from https://github.com/apache/doris/pull/49643
---
 be/src/runtime/types.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/be/src/runtime/types.cpp b/be/src/runtime/types.cpp
index f0112ebd2bc..b64fd139eac 100644
--- a/be/src/runtime/types.cpp
+++ b/be/src/runtime/types.cpp
@@ -167,6 +167,8 @@ void TypeDescriptor::to_thrift(TTypeDesc* thrift_type) 
const {
             scalar_type.__set_scale(scale);
         } else if (type == TYPE_DATETIMEV2) {
             DCHECK_NE(scale, -1);
+            scalar_type.__set_precision(
+                    precision); // -1, adapting upgrade and downgrade 
compatibility.
             scalar_type.__set_scale(scale);
         }
     }
@@ -187,6 +189,7 @@ void TypeDescriptor::to_protobuf(PTypeDesc* ptype) const {
         scalar_type->set_scale(scale);
     } else if (type == TYPE_DATETIMEV2) {
         DCHECK_NE(scale, -1);
+        scalar_type->set_precision(precision); // -1, adapting upgrade and 
downgrade compatibility.
         scalar_type->set_scale(scale);
     } else if (type == TYPE_ARRAY) {
         node->set_type(TTypeNodeType::ARRAY);


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

Reply via email to