feiniaofeiafei opened a new pull request, #62358:
URL: https://github.com/apache/doris/pull/62358
### What problem does this PR solve?
Issue Number: N/A
Problem Summary:
When a query uses the `/*+ no_use_cbo_rule(RULE_NAME) */` hint, the hint was
silently ignored. The root cause was that `EliminateLogicalSelectHint#build`
only handled the `USE_CBO_RULE` hint name but had no branch for
`NO_USE_CBO_RULE`. As a result, the hint fell into the else branch which just
logged a warning and skipped it, so the CBO rule was never disabled.
**Fix:** add `NO_USE_CBO_RULE` to the existing `USE_CBO_RULE` condition so
both hint names are routed to `extractRule()`, which already handles both cases
via the `isNotUseCboRule` flag on `SelectHintUseCboRule`.
Example query that was broken before this fix:
```sql
explain physical plan
SELECT /*+ no_use_cbo_rule(INFER_SET_OPERATOR_DISTINCT)*/ ka, kb, kc
FROM t1 INTERSECT SELECT ka, kb, kc FROM t2
```
### Release note
Fix: `no_use_cbo_rule` hint now correctly disables the specified CBO rewrite
rule instead of being silently ignored.
### Check List (For Author)
- Test: FE unit test added (`EliminateLogicalSelectHintTest`)
- Unit Test
- Behavior changed: Yes — `no_use_cbo_rule` hint now takes effect
- Does this need documentation: No
--
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]