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


##########
be/src/core/data_type_serde/data_type_variant_serde.cpp:
##########
@@ -108,11 +104,11 @@ Status 
DataTypeVariantSerDe::serialize_one_cell_to_json(const IColumn& column, i
 
 Status DataTypeVariantSerDe::deserialize_one_cell_from_json(IColumn& column, 
Slice& slice,
                                                             const 
FormatOptions& options) const {
-    ParseConfig parse_config;
-    parse_config.check_duplicate_json_path = 
config::variant_enable_duplicate_json_path_check;
-    StringRef json_ref(slice.data, slice.size);
-    RETURN_IF_CATCH_EXCEPTION(
-            variant_util::parse_json_to_variant(column, json_ref, nullptr, 
parse_config));
+    auto& variant = assert_cast<ColumnVariant&>(column);
+    Field field = Field::create_field<TYPE_STRING>(String(slice.data, 
slice.size));
+    VariantMap object;

Review Comment:
   This serde is also used by the generic cast path, not only by stream load. 
`cast_from_string_to_generic()` calls `serde->deserialize_one_cell_from_json()` 
for `CAST(string AS VARIANT)`, and existing suites rely on `cast('{"a":1}' as 
variant)['a']` exposing subpaths. With this change the same input is always 
inserted as a root `TYPE_STRING`, so query-time casts no longer parse the JSON 
object and subpath access like `c1['a']` returns missing/null instead of `1`. 
This is distinct from the direct Variant stream-load concern because it affects 
expression evaluation without the later storage-layer 
`parse_and_materialize_variant_columns()` pass. Please keep the old parse 
behavior for casts/generic serde callers and restrict raw-root preservation to 
the load path that can materialize later, and add a regression for 
`cast('{"a":1}' as variant)['a']`.



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