mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 05:30:19 +00:00
Implement is [not] distinct from (#361)
* Implement is [not] distinct from * Simplify message * Clippy
This commit is contained in:
parent
c9f8a44b55
commit
0f0b327e97
4 changed files with 47 additions and 7 deletions
|
@ -917,8 +917,18 @@ impl<'a> Parser<'a> {
|
|||
Ok(Expr::IsNull(Box::new(expr)))
|
||||
} else if self.parse_keywords(&[Keyword::NOT, Keyword::NULL]) {
|
||||
Ok(Expr::IsNotNull(Box::new(expr)))
|
||||
} else if self.parse_keywords(&[Keyword::DISTINCT, Keyword::FROM]) {
|
||||
let expr2 = self.parse_expr()?;
|
||||
Ok(Expr::IsDistinctFrom(Box::new(expr), Box::new(expr2)))
|
||||
} else if self.parse_keywords(&[Keyword::NOT, Keyword::DISTINCT, Keyword::FROM])
|
||||
{
|
||||
let expr2 = self.parse_expr()?;
|
||||
Ok(Expr::IsNotDistinctFrom(Box::new(expr), Box::new(expr2)))
|
||||
} else {
|
||||
self.expected("NULL or NOT NULL after IS", self.peek_token())
|
||||
self.expected(
|
||||
"[NOT] NULL or [NOT] DISTINCT FROM after IS",
|
||||
self.peek_token(),
|
||||
)
|
||||
}
|
||||
}
|
||||
Keyword::NOT | Keyword::IN | Keyword::BETWEEN => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue