Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,8 @@ pub const RESERVED_FOR_TABLE_ALIAS: &[Keyword] = &[
Keyword::ANTI,
Keyword::SEMI,
Keyword::RETURNING,
Keyword::ASOF,
Keyword::MATCH_CONDITION,
// for MSSQL-specific OUTER APPLY (seems reserved in most dialects)
Keyword::OUTER,
Keyword::SET,
Expand Down
14 changes: 14 additions & 0 deletions tests/sqlparser_snowflake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,20 @@ fn asof_joins() {
"ON s.state = p.state ",
"ORDER BY s.observed",
));

// Test without explicit aliases
#[rustfmt::skip]
snowflake_and_generic().verified_query(concat!(
"SELECT * ",
"FROM snowtime ",
"ASOF JOIN raintime ",
"MATCH_CONDITION (snowtime.observed >= raintime.observed) ",
"ON snowtime.state = raintime.state ",
"ASOF JOIN preciptime ",
"MATCH_CONDITION (showtime.observed >= preciptime.observed) ",
"ON showtime.state = preciptime.state ",
"ORDER BY showtime.observed",
));
}

#[test]
Expand Down