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


##########
be/src/core/data_type_serde/complex_type_deserialize_util.h:
##########
@@ -85,6 +85,16 @@ struct ComplexTypeDeserializeUtil {
         return false;
     }
 
+    static Status process_field(const DataTypeSerDeSPtr& serde, StringRef str, 
Field& field) {
+        str = str.trim_whitespace();
+        if (is_null_string(str)) {
+            field = Field::create_field<TYPE_NULL>(Null {});
+            return Status::OK();
+        }
+        auto str_without_quote = str.trim_quote();
+        return serde->from_fe_string(str_without_quote.to_string(), field);

Review Comment:
   This uses the nested serde's `from_fe_string` directly, but array/map/struct 
nested serdes are `DataTypeNullableSerDe` instances. 
`DataTypeNullableSerDe::from_fe_string` intentionally swallows any nested parse 
failure and returns `OK` with an empty/null `Field`, so a default like 
`ARRAY<INT> DEFAULT '["bad"]'`, `MAP<INT,INT> DEFAULT '{"bad":1}'`, or 
`STRUCT<f1:INT> DEFAULT '{"bad"}'` is accepted by FE as the right literal shape 
and then materialized as NULL/default content instead of being rejected. 
Default values should fail validation/materialization when an element cannot be 
converted to the declared nested type; please use a strict nested conversion 
path here and add negative tests for type-mismatched array/map/struct defaults.



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