Support Snowflake/BigQuery TRIM. (#975)

This commit is contained in:
Zdenko Nevrala 2023-10-06 20:48:18 +02:00 committed by GitHub
parent 5263da68cd
commit 83cb734b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 95 additions and 0 deletions

View file

@ -5225,6 +5225,30 @@ fn parse_trim() {
ParserError::ParserError("Expected ), found: 'xyz'".to_owned()),
parse_sql_statements("SELECT TRIM(FOO 'xyz' FROM 'xyzfooxyz')").unwrap_err()
);
//keep Snowflake/BigQuery TRIM syntax failing
let all_expected_snowflake = TestedDialects {
dialects: vec![
//Box::new(GenericDialect {}),
Box::new(PostgreSqlDialect {}),
Box::new(MsSqlDialect {}),
Box::new(AnsiDialect {}),
//Box::new(SnowflakeDialect {}),
Box::new(HiveDialect {}),
Box::new(RedshiftSqlDialect {}),
Box::new(MySqlDialect {}),
//Box::new(BigQueryDialect {}),
Box::new(SQLiteDialect {}),
Box::new(DuckDbDialect {}),
],
options: None,
};
assert_eq!(
ParserError::ParserError("Expected ), found: 'a'".to_owned()),
all_expected_snowflake
.parse_sql_statements("SELECT TRIM('xyz', 'a')")
.unwrap_err()
);
}
#[test]