This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 794982a668e branch-2.1: [fix](type) Fix TYPE_DATETIMEV2 upgrade and
downgrade compatibility (#52530)
794982a668e is described below
commit 794982a668ebcd07773d4b72428df15846b47d8b
Author: Xinyi Zou <[email protected]>
AuthorDate: Wed Jul 2 09:24:48 2025 +0800
branch-2.1: [fix](type) Fix TYPE_DATETIMEV2 upgrade and downgrade
compatibility (#52530)
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]