Bug 1326842 - Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
Summary: Invalid query when using recursive CTE with translators that do not suport RC...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER3
: 6.3.0
Assignee: Van Halbert
QA Contact: Andrej Smigala
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-13 13:59 UTC by Andrej Smigala
Modified: 2016-08-24 11:43 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-24 11:43:49 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-4135 0 Major Closed Invalid query when using recursive CTE with translators that do not suport RCTE pushdown 2018-07-20 12:59:24 UTC

Description Andrej Smigala 2016-04-13 13:59:07 UTC
When running a recursive common table expression query against a source that does not support recursive cte pushdown, only the recursive part of the query is pushed, which fails, since it references a non-existent table (the cte).

E. g. the query

WITH tmp_cte(id, fk, lvl) AS (

    SELECT id, fk, 0 as lvl FROM SourceModel.cte_source WHERE fk IS NULL

    UNION ALL

    SELECT e.id, e.fk, lvl + 1 as lvl FROM SourceModel.cte_source AS e INNER JOIN tmp_cte AS ecte ON ecte.id = e.fk

    )

SELECT * FROM tmp_cte

against a PostreSQL source results in

Remote org.postgresql.util.PSQLException: ERROR: relation "tmp_cte" does not exist


because this query is pushed down:

SELECT g_0.id, g_0.fk, g_0.lvl FROM tmp_cte AS g_0

Comment 2 JBoss JIRA Server 2016-04-13 19:48:10 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-4135 to Resolved

Comment 3 JBoss JIRA Server 2016-06-05 23:43:59 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-4135 to Closed


Note You need to log in before you can comment on or make changes to this bug.