[JBoss JIRA] (TEIID-4133) SQL Server requires CAST when using NULL in anchor part of recursive CTE
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4133?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4133:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1326826|https://bugzilla.redhat.com/show_bug.cgi?id=1326826] from MODIFIED to ON_QA
> SQL Server requires CAST when using NULL in anchor part of recursive CTE
> ------------------------------------------------------------------------
>
> Key: TEIID-4133
> URL: https://issues.jboss.org/browse/TEIID-4133
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> Running the following query in teiid:
> {code:sql}
> with a (intkey, stringcolumn, lvl) as
> (
> select intkey, NULL as stringcolumn, 0 as lvl from bqt1.smallb where intkey = 1
> union all
> select n.intkey, n.stringkey as stringcolumn, rcte.lvl + 1 as lvl from bqt1.smallb n inner join a rcte on n.intkey = rcte.intkey + 1
> )
> select * from a
> {code}
> results in the following source query:
> {code:sql}
> WITH a (intkey, stringcolumn, lvl) AS
> (
> SELECT SmallB.IntKey, NULL AS stringcolumn, 0 AS lvl FROM SmallB WHERE SmallB.IntKey = 1
> UNION ALL
> SELECT n.IntKey, n.StringKey AS stringcolumn, (rcte.lvl + 1) AS lvl FROM SmallB n INNER JOIN a rcte ON n.IntKey = (rcte.intkey + 1)
> )
> SELECT a.intkey, a.stringcolumn, a.lvl FROM a
> {code}
> which fails on SQL Server with {noformat}Types don't match between the anchor and the recursive part in column "stringcolumn" of recursive query "a".{noformat}.
> The source query should be
> {code:sql}
> WITH a (intkey, stringcolumn, lvl) AS
> (
> SELECT SmallB.IntKey, CAST(NULL AS VARCHAR(10)) AS stringcolumn, 0 AS lvl FROM SmallB WHERE SmallB.IntKey = 1
> UNION ALL
> SELECT n.IntKey, n.StringKey AS stringcolumn, (rcte.lvl + 1) AS lvl FROM SmallB n INNER JOIN a rcte ON n.IntKey = (rcte.intkey + 1)
> )
> SELECT a.intkey, a.stringcolumn, a.lvl FROM a
> {code}
> i.e. the NULL has to be cast to the precise type of the column in the recursive part of the query.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4135) Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4135?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4135:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1326842|https://bugzilla.redhat.com/show_bug.cgi?id=1326842] from MODIFIED to ON_QA
> 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
> Fix For: 9.0, 8.12.5
>
>
> 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)
8 years, 7 months
[JBoss JIRA] (TEIID-4160) Impala - result set is not sorted if ORDER BY is defined in query
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4160?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4160:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1329178|https://bugzilla.redhat.com/show_bug.cgi?id=1329178] from MODIFIED to ON_QA
> Impala - result set is not sorted if ORDER BY is defined in query
> -----------------------------------------------------------------
>
> Key: TEIID-4160
> URL: https://issues.jboss.org/browse/TEIID-4160
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 9.0, 8.12.5, 8.7.6.6_2, 8.13.4
>
>
> Query:
> {code:sql}
> SELECT g_1.StringNum AS c_0 FROM Source.SmallA AS g_1 WHERE g_1.IntKey <= 50 UNION ALL SELECT g_0.StringNum AS c_0 FROM Source.SmallB AS g_0 WHERE g_0.IntKey > 50 ORDER BY c_0
> {code}
> Result: as you can see, nulls are not next to each other
> |StringNum|
> |-24|
> |<null>|
> |-14|
> |-13|
> |-12|
> |-11|
> |-10|
> |-9|
> |-8|
> |<null>|
> |-6
> |-5|
> |...|
> Expected result: this is result of simple query SELECT stringnum FROM source.smalla ORDER BY 1
> |StringNum|
> |-1|
> |-10|
> |-11|
> |-12|
> |-13|
> |-14|
> |-15|
> |...|
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4157) Hive/Impala translator - Translators throw ClassCastException
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4157?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4157:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1329168|https://bugzilla.redhat.com/show_bug.cgi?id=1329168] from MODIFIED to ON_QA
> Hive/Impala translator - Translators throw ClassCastException
> -------------------------------------------------------------
>
> Key: TEIID-4157
> URL: https://issues.jboss.org/browse/TEIID-4157
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> Teiid throws following exception when SQL:
> *SQL*: SELECT a.IntKey FROM BQT1.smalla a UNION ALL SELECT b.IntKey FROM BQT2.Smallb b UNION ALL SELECT c.intkey FROM bqt1.smalla c
> *Result*:
> {code:text}
> 09:28:55,285 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue50) TEIID30019 Unexpected exception for request KrpIKq2zWp0r.7: java.lang.ClassCastException: org.teiid.language.SetQuery cannot be cast to org.teiid.language.Select
> at org.teiid.translator.hive.HiveSQLConversionVisitor.visit(HiveSQLConversionVisitor.java:158)
> at org.teiid.language.SetQuery.acceptVisitor(SetQuery.java:110) [teiid-api-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130)
> at org.teiid.translator.jdbc.TranslatedCommand.translateCommand(TranslatedCommand.java:76)
> at org.teiid.translator.jdbc.JDBCBaseExecution.translateCommand(JDBCBaseExecution.java:120)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:114)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:359) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0-internal]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at com.sun.proxy.$Proxy47.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.5.redhat-3.jar:8.12.5.redhat-3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4158) Hive/Impala translator - select distinct and gorup by is not supported in one query
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4158?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4158:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1329169|https://bugzilla.redhat.com/show_bug.cgi?id=1329169] from MODIFIED to ON_QA
> Hive/Impala translator - select distinct and gorup by is not supported in one query
> -----------------------------------------------------------------------------------
>
> Key: TEIID-4158
> URL: https://issues.jboss.org/browse/TEIID-4158
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> Hive and Impala do not support combination of SELECT DISTINCT and GROUP BY in one SQL query.
> Messages of exceptions:
> Impala - cannot combine SELECT DISTINCT with aggregate functions or GROUP BY
> Hive - SELECT DISTINCT and GROUP BY can not be in the same query.
> DDL:
> {code:sql}
> CREATE VIEW Agg2 (StringNum string)
> AS SELECT BQT1.SmallA.StringNum FROM BQT1.SmallA GROUP BY BQT1.SmallA.StringNum HAVING BQT1.SmallA.StringNum = '1';
> {code}
> Query:
> {code:sql}
> SELECT DISTINCT StringNum FROM VQT.Agg2
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months