Gabriel39 commented on code in PR #68297:
URL: https://github.com/apache/doris/pull/68297#discussion_r4060821846


##########
be/src/core/value/timestamptz_value.cpp:
##########
@@ -38,6 +39,13 @@ std::string TimestampTzValue::to_string(const 
cctz::time_zone& tz, int scale) co
     auto lookup_result = tz.lookup(cur_tz_time);
 
     cctz::civil_second civ = lookup_result.cs;
+    // UTC storage bounds do not guarantee a representable session-local year. 
Reject
+    // overflow before DateTimeV2 formatting could produce an offset-only wire 
value.
+    if (civ.year() < 0 || civ.year() > 9999) {

Review Comment:
   Fixed in 7684c0cfd377c77399f18bac0ffaefc88540e56a. FE string conversion now 
checks the same local-year bounds and declines an out-of-range fold through 
AnalysisException. Using CastException here would incorrectly fold non-strict 
casts to NULL. The new FE test covers CHAR/VARCHAR/STRING, both endpoints and 
cast modes, preservation of the CAST for BE evaluation, and valid UTC endpoint 
folding.



##########
be/src/exprs/create_predicate_function.h:
##########
@@ -106,6 +106,9 @@ typename Traits::BasePtr 
create_predicate_function(PrimitiveType type, bool null
     using Creator = PredicateFunctionCreator<Traits>;
 
     switch (type) {
+    case TYPE_VARBINARY:

Review Comment:
   The sibling comparison and scalar helper paths predate this PR. Building a 
common recursive comparability policy across them is outside this follow-up.



##########
be/src/util/raw_value.h:
##########
@@ -45,6 +46,11 @@ class RawValue {
 // Because crc32 hardware is not equal with zlib crc32
 inline uint32_t RawValue::zlib_crc32(const void* v, size_t len, const 
PrimitiveType& type,
                                      uint32_t seed) {
+    // Reject binary even for NULL instead of reaching the default-type 
assertion or hash path.
+    if (type == TYPE_VARBINARY) {

Review Comment:
   The scalar already reached an unsupported binary hashing path before this 
explicit guard. Moving that failure into FE or defining binary routing-hash 
semantics would broaden this follow-up.



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