livepeer / livepeer/livepeer-data-mcp
[Feedback] :pencil2: correction — Segment users by scope/cohort/td for week 1 predictor analysis
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Feedback (correction)
**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 (triggered incorrectly on valid SELECT queries containing HAVING with subquery aggregates)
```
### Corrected answer
ClickHouse rejects queries with HAVING clauses that reference aggregate functions computed in a subquery when using max() inside HAVING on grouped results from a subquery. Use WHERE in the outer query instead of HAVING when filtering on pre-aggregated flags from a subquery.
### Notes
Several queries failed with 'Only SELECT queries allowed' error despite being valid SELECTs. This appears to be a ClickHouse parser quirk when HAVING contains max() on subquery results. Moving the filter condition to a WHERE clause in an outer wrapper subquery resolves it. Also triggered when using sumIf() in HAVING clauses.
---
_Feedback ID: `35deb6c0-b8e7-48fa-be5e-106a0f411ad5` | Recorded at 2026-03-11T00:44:16.611Z_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the query tool and reproduce the reported failure using valid SELECT queries with HAVING, max(), or sumIf() over subquery results. Compare the current behavior with the documented workaround of moving the filter to an outer WHERE clause; done means valid queries are accepted without weakening rejection of non-SELECT statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100