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

CTEs not completely extracted from successive UNION expressions #1501

Closed
Tiepies opened this issue Jun 22, 2018 · 1 comment
Closed

CTEs not completely extracted from successive UNION expressions #1501

Tiepies opened this issue Jun 22, 2018 · 1 comment
Assignees
Labels
bug Incorrect behavior inside of ibis impala The Apache Impala backend
Milestone

Comments

@Tiepies
Copy link

Tiepies commented Jun 22, 2018

When creating a query that contains more than one UNION expression, CTEs do not get fully extracted to the start of the generated SQL query, resulting in a syntax error:

t = con.table('functional_alltypes')
expr1 = (t.group_by(['tinyint_col', 'string_col']).aggregate(t.double_col.sum().name('metric')))
expr2 = expr1.view()
join1 = (expr1.join(expr2, expr1.string_col == expr2.string_col)[[expr1]])
join2 = join1.view()
join3 = join1.view()
expr = join1.union(join2).union(join3)
impala.error.HiveServer2Error: AnalysisException: Syntax error in line 12:
WITH t0 AS (
^
Encountered: WITH
Expected: INSERT, SELECT, UPSERT, VALUES, COMMA

CAUSED BY: Exception: Syntax error
@cpcloud cpcloud added this to the 0.14 milestone Jun 23, 2018
@cpcloud cpcloud added bug Incorrect behavior inside of ibis impala The Apache Impala backend labels Jun 23, 2018
@cpcloud cpcloud self-assigned this Jun 23, 2018
@cpcloud
Copy link
Member

cpcloud commented Jun 23, 2018

Thanks for the report. Marked as a bug for 0.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis impala The Apache Impala backend
Projects
None yet
Development

No branches or pull requests

2 participants