[fix](nereids) Make role-mapping keywords RULE/CEL/MAPPING non-reserved#64104
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
a0648ba to
5e04d29
Compare
The role-mapping DDL added the keywords RULE, CEL and MAPPING to the lexer but did not add them to the `nonReserved` rule, so they became reserved words. Common SQL that uses them as identifiers, e.g. `INSERT INTO t(..., RULE, ...)`, started failing with "mismatched input 'RULE'". Add the three keywords to `nonReserved`. They only appear in fixed, non-ambiguous positions (`RULE (`, `USING CEL`, `CREATE/DROP ROLE MAPPING`), so the grammar stays unambiguous: verified with ANTLR LL_EXACT_AMBIG_DETECTION reporting zero ambiguities and correct routing of `CREATE ROLE MAPPING ...` vs `CREATE ROLE <name>`. Add unit tests in RoleMappingParserTest and an end-to-end regression case test_role_mapping_keyword.
5e04d29 to
808ef4a
Compare
|
run buildall |
FE UT Coverage ReportIncrement line coverage `` 🎉 |
FE Regression Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29629 ms |
TPC-DS: Total hot run time: 169805 ms |
|
run nonConcurrent |
|
/review |
There was a problem hiding this comment.
I found regression-test standard issues that should be fixed before merge. The grammar change itself is small and focused, and the FE parser unit coverage exercises both identifier usage and role-mapping DDL ambiguity. No additional user-provided focus points were specified.
Critical checkpoint conclusions:
- Goal/test: The goal appears to be making RULE/CEL/MAPPING non-reserved in Nereids. The grammar change accomplishes that, and FE parser coverage is present. The new regression test needs to follow repository regression-test output standards.
- Scope: The parser change is minimal and focused.
- Concurrency/lifecycle/config/compatibility: No concurrency, lifecycle, new config, persistence, FE-BE protocol, or storage-format compatibility concerns found.
- Parallel paths: This PR updates Nereids grammar; I did not find another changed parser path in the actual GitHub PR diff.
- Testing: Coverage targets the right behavior, but the regression case uses inline asserts for deterministic query results and drops the table after the test, both contrary to AGENTS.md regression-test rules.
- Observability/performance/data correctness: No new runtime observability, performance, transaction, or data-visibility concerns found for this parser-only change.
|
PR approved by at least one committer and no changes requested. |
FE Regression Coverage ReportIncrement line coverage |
#61819
The role-mapping DDL added the keywords RULE, CEL and MAPPING to the lexer but did not add them to the
nonReservedrule, so they became reserved words. Common SQL that uses them as identifiers, e.g.INSERT INTO t(..., RULE, ...), started failing with "mismatched input 'RULE'".Add the three keywords to
nonReserved. They only appear in fixed, non-ambiguous positions (RULE (,USING CEL,CREATE/DROP ROLE MAPPING), so the grammar stays unambiguous: verified with ANTLR LL_EXACT_AMBIG_DETECTION reporting zero ambiguities and correct routing ofCREATE ROLE MAPPING ...vsCREATE ROLE <name>.Add unit tests in RoleMappingParserTest and an end-to-end regression case test_role_mapping_keyword.