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


##########
be/src/exprs/function/cast/function_cast.cpp:
##########
@@ -210,8 +210,11 @@ WrapperType prepare_remove_nullable(FunctionContext* 
context, const DataTypePtr&
                 block.insert(block.get_by_position(arguments[0]));
             }
 
+            /// get_nullable_column_info() already scanned the NULL map of the 
source, so the mask is
+            /// handed to the cast only when it really contains a NULL. An all 
zero mask is the common
+            /// case, and passing it would add a load and a branch to every 
row of the cast kernels.
             const NullMap::value_type* arg_null_map = nullptr;
-            if (source_info.is_nullable) {
+            if (source_info.has_null) {

Review Comment:
   [P1] Preserve the NULL mask in the JSONB-source and generic to-JSONB wrappers
   
   This handoff now supplies a source mask, but those two wrappers discard it 
and process every physical row. In the source direction, physical rows 
containing JSONB string `"bad"` and JSONB number `1` with mask `{1,0}` still 
make a strict cast to TINYINT fail on the hidden first payload. In the 
destination direction, casting `IF(p, named_struct(...), NULL)` to JSON can 
fail on a false-`p` row when the literal STRUCT field name is 256 bytes, 
because the generic serializer visits the hidden STRUCT and rejects that name 
in either mode. Please make both vector paths skip masked rows while inserting 
a placeholder per row, and add hidden-invalid/visible-valid plus 
visible-invalid controls for both directions.



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