livepeer / livepeer/livepeer-data-mcp
[Feedback] :thumbsdown: negative — Segment users by scope/cohort/td for week 1 predictor analysis
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Feedback (negative)
**Question:** Segment users by scope/cohort/td for week 1 predictor analysis
**Tool:** `query`
### Error
```
Query rejected: Only SELECT, WITH, EXPLAIN, DESCRIBE, SHOW queries are allowed / Aggregate function min(signup_date) is found in WHERE
```
### Corrected answer
ClickHouse rejects certain valid SELECT queries with 'Only SELECT, WITH, EXPLAIN, DESCRIBE, SHOW queries are allowed' when HAVING contains aggregate functions (max(), sumIf()) over subquery results. This is a parser edge case, not a policy rejection. Workaround: move the HAVING filter into a WHERE clause in an outer wrapper subquery. Also: min() used inside a WHERE clause directly triggers 'Aggregate function min() is found in WHERE' — compute aggregates in a subquery first, then filter in the outer query.
### Notes
These errors are misleading — the queries ARE valid SELECTs. The error messages suggest policy violations but they are actually ClickHouse parser/execution quirks. The query tool should surface a more helpful message like 'ClickHouse parser limitation — try moving aggregates out of HAVING/WHERE into a subquery'. This caused significant confusion and multiple retries during this session.
---
_Feedback ID: `8b4f6426-944b-4889-99ad-96f6bb5a93b6` | Recorded at 2026-03-11T00:52:56.696Z_
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the query tool's handling of ClickHouse errors for the reported aggregate functions in WHERE and HAVING. Review how these errors are surfaced, then confirm the finished behavior gives a helpful parser-limitation message instead of implying a policy rejection for valid SELECT queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100