mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 11:17:23 +00:00
BigQuery support inline comment with hash syntax (#1192)
This commit is contained in:
parent
23103302e6
commit
732e1ec1fc
2 changed files with 19 additions and 1 deletions
|
@ -8607,6 +8607,24 @@ fn test_release_savepoint() {
|
|||
one_statement_parses_to("RELEASE test1", "RELEASE SAVEPOINT test1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_comment_hash_syntax() {
|
||||
let dialects = TestedDialects {
|
||||
dialects: vec![Box::new(BigQueryDialect {}), Box::new(SnowflakeDialect {})],
|
||||
options: None,
|
||||
};
|
||||
let sql = r#"
|
||||
# comment
|
||||
SELECT a, b, c # , d, e
|
||||
FROM T
|
||||
####### comment #################
|
||||
WHERE true
|
||||
# comment
|
||||
"#;
|
||||
let canonical = "SELECT a, b, c FROM T WHERE true";
|
||||
dialects.verified_only_select_with_canonical(sql, canonical);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_buffer_reuse() {
|
||||
let d = GenericDialect {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue