raghav-reglobe commented on PR #69222:
URL: https://github.com/apache/doris/pull/69222#issuecomment-6657040441

   @eldenmoon — this PR touches the Variant core, so two design choices are 
worth your eyes before the auto-requested FE reviewers get to the Nereids half:
   
   1. **Which call gets typed.** The template is attached by a sink-scoped 
rewrite (`TypeVariantTemplateParse`): from the OLAP sink down to the 
`parse_to_variant` / `try_parse_to_variant` call that feeds a templated column, 
through VALUES, SELECT, CTE, UNION and derived-table shapes. A SELECT outside a 
sink keeps its cast and the untyped call, and `SimplifyCastRule` is untouched. 
The earlier draft typed the call in `SimplifyCastRule`; that missed the shapes 
where the cast and the call never become adjacent.
   2. **What crosses the wire.** `TScalarType.variant_template_paths` carries 
the whole Schema Template in declaration order as `TVariantTemplatePath 
{pattern, is_glob, is_decimal}` (renamed from the draft's 
`TVariantDecimalPath`; precision and scale dropped — the emitted decimal's 
width follows the text's own digits, and the column's cast decides the rest). 
The BE matches a path the way the shredder does: first field in declaration 
order, `==` for a literal, `fnmatch(FNM_PATHNAME)` for a glob; an object or an 
array nested inside an array keeps its subtree off every declared path. The 
struct exists on no release branch, and a BE that receives no paths behaves as 
before.
   
   If you would rather see the template matched elsewhere (for instance the 
shredder's own matcher exposed to the parser), say so and I will rework it — 
the BE text reader and its tests stay the same either way.
   


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