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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org