Skip to content

Conversation

@romanoff
Copy link
Contributor

@romanoff romanoff commented Dec 3, 2025

Support parsing parenthesized wildcard (*)

Example of query:

SELECT DISTINCT (*) FROM table1

}

#[test]
fn parse_select_distinct_parenthesized_wildcard() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn parse_select_distinct_parenthesized_wildcard() {
fn parse_select_parenthesized_wildcard() {

thinking since the syntax isn't implemented solely on the distinct keyword?

self.next_token(); // consume RParen
return Ok(Expr::Wildcard(AttachedToken(inner_token)));
}
// Not a (*), reset and fall through to parse_expr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks incorrect per the comment, by reset should we have called prev_token() or similar to undo the consumed inner token *?

Comment on lines 1227 to 1228
let inner_token = self.next_token();
if inner_token.token == Token::Mul && self.peek_token().token == Token::RParen {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be simplified by calling self.peek_tokens_ref(Token::MUL, Token::RParen)?

@romanoff
Copy link
Contributor Author

romanoff commented Dec 5, 2025

@iffyio Updated. Thank you for reviewing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants