github-actions[bot] commented on code in PR #63118:
URL: https://github.com/apache/doris/pull/63118#discussion_r3220292332


##########
be/src/storage/segment/segment.h:
##########
@@ -195,11 +199,10 @@ class Segment : public 
std::enable_shared_from_this<Segment>, public MetadataAdd
             // Default column iterator or not variant column
             return true;
         }
-        if 
(storage_column_type->equals(*target_cast_type_for_variants.at(col->name()))) {
-            return true;
-        } else {
-            return false;
-        }
+        auto normalized_storage_type = remove_nullable(storage_column_type);

Review Comment:
   This exact-type check avoids the unsafe cross-width index encoding that was 
raised earlier, but it also means the PR no longer fixes the reproduction in 
the PR body. For the inserted values `1..20`, the new regression test itself 
documents the inferred storage type as `TINYINT`; when the query is the 
original `CAST(v["int_key"] AS INT) = 13`, `target_cast_type_for_variants` is 
`INT`, `storage_column_type` is `TINYINT`, and this returns `false`, so the 
common expression remains outside the inverted-index path and the scan still 
reads all rows. The added positive test was changed to `CAST AS TINYINT`, so it 
does not prove the stated `CAST AS INT` behavior. Please either implement a 
safe conversion of predicate values to the segment storage type with 
range/overflow checks, or narrow the PR/test expectations so they no longer 
claim to fix the `INT` cast case.



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