aleksei-akhundov-db opened a new pull request, #58826: URL: https://github.com/apache/spark/pull/58826
### What changes were proposed in this pull request? Restrict SQL hint recognition to a `/*+` opener at the start of the current lexer token. Hint-shaped comments nested inside bracketed comments remain part of the outer comment. Add parser and statement-splitter coverage for nested hint-shaped comments, including multiple and deeply nested comments, a subsequent real hint, and unclosed comments. ### Why are the changes needed? Spark currently treats `/*+` anywhere inside a bracketed comment as the start of a SQL hint. This ends the outer comment early and causes its remaining text to be parsed as SQL. For example, this valid query fails to parse: ```sql SELECT /* outer /*+ inner */ outer tail */ 1 AS col1 ``` ### Does this PR introduce _any_ user-facing change? Yes. Hint-shaped comments nested inside bracketed comments are now parsed as comment text, so valid queries containing them parse successfully. ### How was this patch tested? Added tests to `PlanParserSuite` and `SqlStatementSplitterSuite`. The corresponding suites pass in the Databricks Runtime Spark build (123 and 84 tests, respectively). ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-5) -- 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]
