Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL API: Join with CTEs is not working #8420

Open
kderbalah opened this issue Jul 2, 2024 · 0 comments
Open

SQL API: Join with CTEs is not working #8420

kderbalah opened this issue Jul 2, 2024 · 0 comments

Comments

@kderbalah
Copy link

Failed SQL

with this_week as (
    SELECT country, MEASURE(num_customers) AS total_customers_this_week
    FROM customers
    WHERE week_utc = (EXTRACT(YEAR FROM CURRENT_DATE) + 0) * 100 + EXTRACT(WEEK FROM CURRENT_DATE) + 0
    GROUP BY country
), last_week as (
    SELECT country, MEASURE(num_customers) AS total_customers_last_week
    FROM customers
    WHERE week_utc = (EXTRACT(YEAR FROM CURRENT_DATE) + 0) * 100 + EXTRACT(WEEK FROM CURRENT_DATE) - 1
    GROUP BY country
)
SELECT this_week.country, total_customers_this_week, total_customers_last_week
FROM this_week
join last_week 
on this_week.country = last_week.country

Error
SQL Error [XX000]: ERROR: Error during rewrite: Use __cubeJoinField to join Cubes.

Logical Plan
Error during planning

Version:
v0.35.55

Additional context
I see same error when enabling SQL pushdown

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

No branches or pull requests

1 participant