mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-04 13:10:31 +00:00
implement NOT
This commit is contained in:
parent
2240dd09ff
commit
7aab880387
3 changed files with 17 additions and 0 deletions
|
@ -108,6 +108,10 @@ impl Parser {
|
|||
self.parse_sql_value()
|
||||
}
|
||||
"CASE" => self.parse_case_expression(),
|
||||
"NOT" => Ok(ASTNode::SQLUnary {
|
||||
operator: SQLOperator::Not,
|
||||
rex: Box::new(self.parse_expr(0)?),
|
||||
}),
|
||||
_ => return parser_err!(format!("No prefix parser for keyword {}", k)),
|
||||
},
|
||||
Token::Mult => Ok(ASTNode::SQLWildcard),
|
||||
|
@ -329,6 +333,7 @@ impl Parser {
|
|||
&Token::Mod => Ok(SQLOperator::Modulus),
|
||||
&Token::Keyword(ref k) if k == "AND" => Ok(SQLOperator::And),
|
||||
&Token::Keyword(ref k) if k == "OR" => Ok(SQLOperator::Or),
|
||||
&Token::Keyword(ref k) if k == "NOT" => Ok(SQLOperator::Not),
|
||||
&Token::Keyword(ref k) if k == "LIKE" => Ok(SQLOperator::Like),
|
||||
_ => parser_err!(format!("Unsupported SQL operator {:?}", tok)),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue