iffyio commented on code in PR #1969: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1969#discussion_r2244788996
########## src/parser/mod.rs: ########## @@ -13882,11 +13892,25 @@ impl<'a> Parser<'a> { None }; self.expect_token(&Token::LParen)?; - let value = self.parse_identifier()?; + let value = match self.peek_token_ref().token { + Token::LParen => { + // multi value column unpivot + Expr::Tuple( + self.parse_parenthesized_column_list(Mandatory, false)? + .into_iter() + .map(Expr::Identifier) + .collect(), + ) + } + _ => { + // single value column unpivot + Expr::Identifier(self.parse_identifier()?) + } Review Comment: Ah yes I think it would be ok for the parser to be permissive in this case, downstream crates are expected to validate the AST further if needed. Related can we add a test case that uses a [fully qualified column name](https://github.com/apache/datafusion-sqlparser-rs/pull/1969#discussion_r2239416734)? e.g. `FOR half_of_the_year IN ((foo.bar, bar.baz) AS x)` - if I understand the intent correctly I think the parser is supposed to successfully parse that whereas with the current impl it is unable to -- 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