mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Do not parse ASOF and MATCH_CONDITION as table factor aliases (#1698)
This commit is contained in:
parent
447142c6d0
commit
c3256a80d7
2 changed files with 16 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue