Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dialect/snowflake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ impl Dialect for SnowflakeDialect {
true
}

/// See <https://docs.snowflake.com/en/sql-reference/constructs/order-by#syntax>
fn supports_order_by_all(&self) -> bool {
true
}

// Snowflake supports double-dot notation when the schema name is not specified
// In this case the default PUBLIC schema is used
//
Expand Down
13 changes: 13 additions & 0 deletions tests/sqlparser_snowflake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ fn test_snowflake_create_table() {
}
}

#[test]
fn parse_order_by_all() {
let query = snowflake()
.verified_query("SELECT value + 1 AS computed FROM source ORDER BY ALL DESC NULLS FIRST");
assert_eq!(
query.order_by.expect("ORDER BY expected").kind,
OrderByKind::All(OrderByOptions {
sort: Some(OrderBySort::Desc),
nulls_first: Some(true),
})
);
}

#[test]
fn parse_sf_create_secure_view_and_materialized_view() {
for sql in [
Expand Down
Loading