diff --git a/be/src/runtime/types.cpp b/be/src/runtime/types.cpp index f0112ebd2b..b64fd139ea 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);