csun5285 commented on code in PR #62960:
URL: https://github.com/apache/doris/pull/62960#discussion_r3168751515


##########
be/src/core/type_limit.h:
##########
@@ -54,6 +56,24 @@ struct type_limit<DecimalV2Value> {
     static DecimalV2Value max() { return DecimalV2Value::get_max_decimal(); }
 };
 
+// std::numeric_limits is not specialised for these custom storage types, so
+// the generic type_limit would return T() = zero for both min and max,
+// silently breaking BKD half-bounded range queries.
+
+// DECIMALV2 storage. Largest representable DecimalV2 value (18 digits . 9 
digits).
+template <>
+struct type_limit<decimal12_t> {
+    static decimal12_t min() { return decimal12_t {-999999999999999999LL, 
-999999999}; }
+    static decimal12_t max() { return decimal12_t {+999999999999999999LL, 
+999999999}; }
+};
+
+// DATE storage. Packed as `year<<9 | month<<5 | day`: 33=0001-01-01, 
5119903=9999-12-31.
+template <>
+struct type_limit<uint24_t> {

Review Comment:
   别的类型也是这样,这里是特化的模板



-- 
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]

Reply via email to