Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-37389][SQL] Check unclosed bracketed comments
### What changes were proposed in this pull request? The SQL below has unclosed bracketed comment. ``` /*abc*/ select 1 as a /* 2 as b /*abc*/ , 3 as c /**/ ; ``` But Spark outputs: <!DOCTYPE html> a | -- | 1 | PostgreSQL also supports the feature, but output: ``` SQL 错误 [42601]: Unterminated block comment started at position 22 in SQL /*abc*/ select 1 as a /* 2 as b /*abc*/ , 3 as c /**/ ;. Expected */ sequence ``` ### Why are the changes needed? The execute plan is not expected, if we don't check unclosed bracketed comments. ### Does this PR introduce _any_ user-facing change? 'Yes'. The behavior of bracketed comments will more correctly. ### How was this patch tested? New tests. Closes #34668 from beliefer/SPARK-37389. Authored-by: Jiaan Geng <beliefer@163.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information
Showing
6 changed files
with
218 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters