altmannmarcelo opened a new pull request, #2216:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2216

   Two orthogonal improvements to optimizer hint parsing:
   
   1. `Option<OptimizerHint>` -> `Vec<OptimizerHint>`: the old Option silently 
dropped all but the first hint-style comment. Vec preserves all hint comments 
the parser encounters, letting consumers decide which to use. This is backwards 
compatible: `optimizer_hint: None` becomes `optimizer_hints: vec![]`, and 
`optimizer_hint.unwrap()` becomes `optimizer_hints[0]`.
   
   2. Generic prefix extraction: the `/*+...*/` pattern is an established 
convention. Various systems extend it with `/*prefix+...*/` where the prefix is 
opaque alphanumeric text before `+`. Rather than adding a new dialect flag or 
struct for each system, the parser now captures any `[a-zA-Z0-9]*` run before 
`+` as a `prefix` field. Standard hints have `prefix: ""`. No new dialect 
surface -- same `supports_comment_optimizer_hint()` gate. This makes 
OptimizerHint a generic extension point: downstream consumers can define their 
own prefixed hint conventions and filter hints by prefix, without requiring any 
changes to the parser or dialect configuration.


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