Parse ARRAY_AGG for Bigquery and Snowflake (#662)

This commit is contained in:
SuperBo 2022-11-12 03:25:07 +07:00 committed by GitHub
parent 0428ac742b
commit 87b4a168cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 156 additions and 4 deletions

View file

@ -1777,6 +1777,27 @@ fn parse_listagg() {
);
}
#[test]
fn parse_array_agg_func() {
let supported_dialects = TestedDialects {
dialects: vec![
Box::new(GenericDialect {}),
Box::new(PostgreSqlDialect {}),
Box::new(MsSqlDialect {}),
Box::new(AnsiDialect {}),
Box::new(HiveDialect {}),
],
};
for sql in [
"SELECT ARRAY_AGG(x ORDER BY x) AS a FROM T",
"SELECT ARRAY_AGG(x ORDER BY x LIMIT 2) FROM tbl",
"SELECT ARRAY_AGG(DISTINCT x ORDER BY x LIMIT 2) FROM tbl",
] {
supported_dialects.verified_stmt(sql);
}
}
#[test]
fn parse_create_table() {
let sql = "CREATE TABLE uk_cities (\