mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-27 07:59:11 +00:00
Snowflake: support IGNORE/RESPECT NULLS inside function argument list (#1263)
This commit is contained in:
parent
5ed13b5af3
commit
54184460b5
2 changed files with 15 additions and 0 deletions
|
@ -71,6 +71,12 @@ impl Dialect for SnowflakeDialect {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Snowflake doesn't document this but `FIRST_VALUE(arg, { IGNORE | RESPECT } NULLS)`
|
||||||
|
// works (i.e. inside the argument list instead of after).
|
||||||
|
fn supports_window_function_null_treatment_arg(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
/// See [doc](https://docs.snowflake.com/en/sql-reference/sql/set#syntax)
|
/// See [doc](https://docs.snowflake.com/en/sql-reference/sql/set#syntax)
|
||||||
fn supports_parenthesized_set_variables(&self) -> bool {
|
fn supports_parenthesized_set_variables(&self) -> bool {
|
||||||
true
|
true
|
||||||
|
|
|
@ -1576,3 +1576,12 @@ fn test_select_wildcard_with_ilike_replace() {
|
||||||
"sql parser error: Expected end of statement, found: EXCLUDE"
|
"sql parser error: Expected end of statement, found: EXCLUDE"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn first_value_ignore_nulls() {
|
||||||
|
snowflake().verified_only_select(concat!(
|
||||||
|
"SELECT FIRST_VALUE(column2 IGNORE NULLS) ",
|
||||||
|
"OVER (PARTITION BY column1 ORDER BY column2) ",
|
||||||
|
"FROM some_table"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue