Use polyglot-sql in Rust query generation#175
Conversation
15c979b to
c46035e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c46035eff3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !rest.chars().next()?.is_whitespace() { | ||
| return None; | ||
| } |
There was a problem hiding this comment.
Parse COUNT(DISTINCT(...)) as count_distinct
The new top-level metric parser only treats COUNT as distinct when DISTINCT is followed by whitespace, so inputs like COUNT(DISTINCT(customer_id)) now fall through as plain count with sql = "DISTINCT(customer_id)". In practice this generates invalid/incorrect SQL (DISTINCT(customer_id) as a projected expression plus COUNT(...)) instead of COUNT(DISTINCT ...), which regresses valid metric definitions that use the parenthesized DISTINCT form.
Useful? React with 👍 / 👎.
Summary
MEDIAN()maps correctly,COUNT(DISTINCT ...)normalizes, and unknown function calls stay expression metrics.