You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collect multiple optimizer hints per statement and extract comment prefix
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.
0 commit comments