jitendrakr88 opened a new pull request, #15498: URL: https://github.com/apache/pinot/pull/15498
## Summary This change removes the regex-based parser in `CalciteSqlParser` for handling `OPTION(...)` clauses in SQL queries and replaces it with a simple, linear-time parser (`QueryOptionParser`). The new implementation avoids regex backtracking issues, which can cause performance problems in large queries or when there's excessive whitespace and formatting. **Example:** ```sql SELECT a, b, c FROM myTable OPTION(timeoutMs=100, a=b, c=d) ``` ## Improvement Created a synthetic SQL query with a large amount of trailing whitespace to highlight the difference in behaviour: ```java String sql = "SELECT * FROM t " + " ".repeat(20000); ``` - Regex-based parser time: ~750ms - New parser time: ~150ms -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org