iffyio commented on code in PR #1724:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1724#discussion_r1963053134
##########
src/parser/mod.rs:
##########
@@ -9191,17 +9191,31 @@ impl<'a> Parser<'a> {
pub fn parse_optional_order_by(&mut self) -> Result<Option<OrderBy>,
ParserError> {
if self.parse_keywords(&[Keyword::ORDER, Keyword::BY]) {
- let order_by_exprs =
self.parse_comma_separated(Parser::parse_order_by_expr)?;
- let interpolate = if dialect_of!(self is ClickHouseDialect |
GenericDialect) {
- self.parse_interpolations()?
+ let order_by = if self.parse_keyword(Keyword::ALL) {
+ if !self.dialect.supports_order_by_all() {
+ return parser_err!(
+ "ALL is not supported in ORDER BY",
+ self.peek_token().span.start
+ );
+ }
Review Comment:
Yeah the latter, if an unsupporting dialect sees the query `ORDER BY ALL` it
implies that there's a column/variable in scope called `ALL` i.e all is an
identifier so it'll indeed be correct to parse it as an expression
--
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]