branch-2.1: [fix](type) Fix TYPE_DATETIMEV2 upgrade and downgrade compatibility (#52530)
Introduced from https://github.com/apache/doris/pull/49643
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user