wugeer commented on code in PR #1472:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1472#discussion_r1807356535
##########
src/parser/mod.rs:
##########
@@ -2796,9 +2811,27 @@ impl<'a> Parser<'a> {
format: None,
})
} else if Token::ExclamationMark == tok {
- // PostgreSQL factorial operation
+ match expr {
+ Expr::Value(_) | Expr::Identifier(_) => {
+ if !self.dialect.supports_factorial_operator() {
+ return parser_err!(
+ format!(
+ "current dialect: {:?} does not support
factorial operator",
+ self.dialect
+ ),
+ self.peek_token().location
+ );
+ }
+ }
+ _ => {}
+ };
+ let op = if !self.dialect.supports_factorial_operator() {
+ UnaryOperator::SpecialNot
+ } else {
+ UnaryOperator::PGPostfixFactorial
+ };
Review Comment:
Good idea, I will try it. :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]