cube-js / cube-js/cube

SQL API: Failed to plan inner queries with `IN`

Open
#8,422 0 comments 0 reactions 1 assignee Claimed by @igorlukanin View on GitHub
api:sql
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Failed SQL**
```sql
SELECT country, MEASURE(checkout_rate) AS checkout_rate
FROM customers
WHERE country IN (
SELECT country
FROM customers
GROUP BY country
ORDER BY SUM(num_customers) DESC
LIMIT 5
)
AND year_utc = EXTRACT(YEAR FROM CURRENT_DATE) + 0
GROUP BY country, week_of_year_utc
ORDER BY week_of_year_utc, checkout_rate DESC
```

**Error**
SQL Error [XX000]: ERROR: Error during rewrite: Can't detect Cube query and it may be not supported yet.

**Logical Plan**
Error during planning

**Version:**
v0.35.55

**Additional context**
I see same error when enabling SQL pushdown

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.