Skip to content

fix: support expressions (dotted column refs) in DISTINCT ON#258

Merged
git-hulk merged 2 commits intoAfterShip:masterfrom
cloudquery:fix/distinct-on-dot-notation
Mar 17, 2026
Merged

fix: support expressions (dotted column refs) in DISTINCT ON#258
git-hulk merged 2 commits intoAfterShip:masterfrom
cloudquery:fix/distinct-on-dot-notation

Conversation

@disq
Copy link
Copy Markdown
Contributor

@disq disq commented Mar 16, 2026

parseDistinctOn() was calling parseIdent() which only handles simple identifiers. Queries like DISTINCT ON (t.id, t.name) would fail because the dot was not recognized. Changed to ParseNestedIdentifier() so that table.column references are accepted.

parseDistinctOn() was calling parseIdent() which only handles simple
identifiers. Queries like DISTINCT ON (t.id, t.name) would fail because
the dot was not recognized. Changed to parseExpr() so that any valid
column expression (including table.column references) is accepted.
@git-hulk
Copy link
Copy Markdown
Member

@disq Thanks for your fix. Left one comment.

@disq disq requested a review from git-hulk March 16, 2026 16:36
@git-hulk git-hulk merged commit 4a3c96e into AfterShip:master Mar 17, 2026
1 check passed
@git-hulk
Copy link
Copy Markdown
Member

@disq Thanks for your contribution.

@disq
Copy link
Copy Markdown
Contributor Author

disq commented Mar 17, 2026

Thanks for the review and merge, just updated the PR body to match as well.

@disq disq deleted the fix/distinct-on-dot-notation branch March 17, 2026 09:34
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