morrySnow opened a new pull request, #67685:
URL: https://github.com/apache/doris/pull/67685

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: None
   
   Problem Summary:
   
   The `errorCapturingIdentifier` rule always entered a nullable helper for 
valid identifiers. In the tracked SQL corpus this created 25,406 empty CST 
contexts. Move the optionality to the caller and make 
`errorCapturingIdentifierExtra` non-empty, while preserving the existing 
unquoted-identifier error action. This avoids allocating an empty 
`RealIdentContext` on the common path and keeps the grammar structure 
straightforward.
   
   This PR also removes stale `PostProcessor` references from two JMH 
harnesses. Identifier post-processing already moved into grammar actions and 
the class no longer exists, so those references prevented the benchmark profile 
from compiling.
   
   Add a multipart-identifier JMH workload and a direct CST regression test. 
Across two JMH runs, normalized allocation for that workload decreased from 
174,368.9 to 159,004.1 B/op (-8.81%) end-to-end and from 146,097.7 to 130,741.3 
B/op (-10.51%) with pre-tokenized input.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
           - `mvn -pl fe-sql-parser -am -Dmaven.build.cache.enabled=false test` 
(248 tests passed)
           - `./run-fe-ut.sh --run 
org.apache.doris.nereids.parser.NereidsParserTest,org.apache.doris.nereids.parser.NereidsParserDigestTest`
 (89 tests passed)
       - [x] Manual test (add detailed scripts or steps below)
           - `mvn -Pbenchmark -pl fe-sql-parser-benchmark -am -DskipTests 
-Dmaven.build.cache.enabled=false package`
           - Compared the baseline and candidate across 4,610 tracked SQL files 
in both legacy and ANSI modes: 4,275 successful parses, 335 expected failures, 
and 1,413,680 tokens in each run.
           - Compared error snapshots for valid, quoted, non-reserved, 
multipart, arithmetic, and malformed identifiers; baseline and candidate 
results matched.
           - Ran the multipart JMH allocation benchmark twice.
           - `./build.sh --fe` passed the SQL parser and connector modules, 
then was blocked by pre-existing JUnit 4 Checkstyle violations in 
`CacheHotspotManagerSchedulerTest` on the current base branch.
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No. SQL syntax, tokens, AST behavior, and parse errors are 
unchanged. The internal CST and generated visitor/listener API no longer 
contain `RealIdentContext` for valid identifiers.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   


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