[teiid-issues] [JBoss JIRA] (TEIID-4135) Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
Andrej Šmigala (JIRA)
issues at jboss.org
Wed Apr 13 09:58:00 EDT 2016
Andrej Šmigala created TEIID-4135:
-------------------------------------
Summary: Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
Key: TEIID-4135
URL: https://issues.jboss.org/browse/TEIID-4135
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
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
{code:sql}
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
{code}
against a PostreSQL source results in {noformat}Remote org.postgresql.util.PSQLException: ERROR: relation "tmp_cte" does not exist{noformat}
because this query is pushed down:
{code:sql}SELECT g_0.id, g_0.fk, g_0.lvl FROM tmp_cte AS g_0{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the teiid-issues
mailing list