yiguolei commented on code in PR #51766:
URL: https://github.com/apache/doris/pull/51766#discussion_r2155867532
##########
be/src/util/jsonb_document.h:
##########
@@ -1227,46 +1257,18 @@ inline unsigned int JsonbValue::numPackedBytes() const {
case JsonbType::T_Array: {
return ((ContainerVal*)(this))->numPackedBytes();
}
- default:
- return 0;
+ case JsonbType::T_Decimal32: {
+ return JsonbDecimal32::numPackedBytes();
}
-}
-
-inline unsigned int JsonbValue::size() const {
- switch (type_) {
- case JsonbType::T_Int8: {
- return sizeof(int8_t);
+ case JsonbType::T_Decimal64: {
+ return JsonbDecimal64::numPackedBytes();
}
- case JsonbType::T_Int16: {
- return sizeof(int16_t);
+ case JsonbType::T_Decimal128: {
+ return JsonbDecimal128::numPackedBytes();
}
- case JsonbType::T_Int32: {
- return sizeof(int32_t);
+ case JsonbType::T_Decimal256: {
+ return JsonbDecimal256::numPackedBytes();
}
- case JsonbType::T_Int64: {
- return sizeof(int64_t);
- }
- case JsonbType::T_Double: {
- return sizeof(double);
- }
- case JsonbType::T_Float: {
- return sizeof(float);
- }
- case JsonbType::T_Int128: {
- return sizeof(int128_t);
- }
- case JsonbType::T_String:
- case JsonbType::T_Binary: {
- return ((JsonbBlobVal*)(this))->getBlobLen();
- }
-
- case JsonbType::T_Object:
- case JsonbType::T_Array: {
- return ((ContainerVal*)(this))->getContainerSize();
- }
- case JsonbType::T_Null:
- case JsonbType::T_True:
- case JsonbType::T_False:
default:
return 0;
}
Review Comment:
这里的default 为什么不是抛异常?而是返回一个0?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]