mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 13:40:22 +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::ANTI,
|
||||||
Keyword::SEMI,
|
Keyword::SEMI,
|
||||||
Keyword::RETURNING,
|
Keyword::RETURNING,
|
||||||
|
Keyword::ASOF,
|
||||||
|
Keyword::MATCH_CONDITION,
|
||||||
// for MSSQL-specific OUTER APPLY (seems reserved in most dialects)
|
// for MSSQL-specific OUTER APPLY (seems reserved in most dialects)
|
||||||
Keyword::OUTER,
|
Keyword::OUTER,
|
||||||
Keyword::SET,
|
Keyword::SET,
|
||||||
|
|
|
@ -2731,6 +2731,20 @@ fn asof_joins() {
|
||||||
"ON s.state = p.state ",
|
"ON s.state = p.state ",
|
||||||
"ORDER BY s.observed",
|
"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]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue