[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by sameer P (JIRA)
[ https://issues.jboss.org/browse/TEIID-5437?page=com.atlassian.jira.plugin... ]
sameer P commented on TEIID-5437:
---------------------------------
Aah yeah that's right. Thanks!
> ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
> ----------------------------------------------------------
>
> Key: TEIID-5437
> URL: https://issues.jboss.org/browse/TEIID-5437
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: sameer P
> Assignee: Steven Hawkins
> Priority: Critical
>
> Combining union all and order by does not work when the query is pushed down to PostgreSQL.
> The following query with dsp and dwh as postgres datasources,
> {code:sql}
> select * from (
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> )x order by col1
> {code}
> Fails with the below errors:
> {code:java}
> Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
> SQLState: 50000
> ErrorCode: 30504
> {code}
> Where as the following query works without any problem:
> {code:sql}
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5437?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5437:
---------------------------------------
This still occurs on master. A missing detail is that it needs to be an ordered limit - x order by col1 limit 100
I should be able to address this shortly.
> ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
> ----------------------------------------------------------
>
> Key: TEIID-5437
> URL: https://issues.jboss.org/browse/TEIID-5437
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: sameer P
> Assignee: Steven Hawkins
> Priority: Critical
>
> Combining union all and order by does not work when the query is pushed down to PostgreSQL.
> The following query with dsp and dwh as postgres datasources,
> {code:sql}
> select * from (
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> )x order by col1
> {code}
> Fails with the below errors:
> {code:java}
> Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
> SQLState: 50000
> ErrorCode: 30504
> {code}
> Where as the following query works without any problem:
> {code:sql}
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by sameer P (JIRA)
[ https://issues.jboss.org/browse/TEIID-5437?page=com.atlassian.jira.plugin... ]
sameer P commented on TEIID-5437:
---------------------------------
[~shawkins] it was on 10.2.1 . As I had a same working copy of that . Should I try the same on latest version?
> ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
> ----------------------------------------------------------
>
> Key: TEIID-5437
> URL: https://issues.jboss.org/browse/TEIID-5437
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: sameer P
> Assignee: Steven Hawkins
> Priority: Critical
>
> Combining union all and order by does not work when the query is pushed down to PostgreSQL.
> The following query with dsp and dwh as postgres datasources,
> {code:sql}
> select * from (
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> )x order by col1
> {code}
> Fails with the below errors:
> {code:java}
> Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
> SQLState: 50000
> ErrorCode: 30504
> {code}
> Where as the following query works without any problem:
> {code:sql}
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5437?page=com.atlassian.jira.plugin... ]
Steven Hawkins reassigned TEIID-5437:
-------------------------------------
Component/s: Query Engine
Priority: Critical (was: Blocker)
Assignee: Steven Hawkins (was: Barry LaFond)
What version of teiid is this?
> ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
> ----------------------------------------------------------
>
> Key: TEIID-5437
> URL: https://issues.jboss.org/browse/TEIID-5437
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: sameer P
> Assignee: Steven Hawkins
> Priority: Critical
>
> Combining union all and order by does not work when the query is pushed down to PostgreSQL.
> The following query with dsp and dwh as postgres datasources,
> {code:sql}
> select * from (
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> )x order by col1
> {code}
> Fails with the below errors:
> {code:java}
> Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
> SQLState: 50000
> ErrorCode: 30504
> {code}
> Where as the following query works without any problem:
> {code:sql}
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by sameer P (JIRA)
[ https://issues.jboss.org/browse/TEIID-5437?page=com.atlassian.jira.plugin... ]
sameer P updated TEIID-5437:
----------------------------
Component/s: (was: Connector API)
(was: Grammar)
(was: Query Engine)
> ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
> ----------------------------------------------------------
>
> Key: TEIID-5437
> URL: https://issues.jboss.org/browse/TEIID-5437
> Project: Teiid
> Issue Type: Bug
> Reporter: sameer P
> Assignee: Barry LaFond
> Priority: Blocker
>
> Combining union all and order by does not work when the query is pushed down to PostgreSQL.
> The following query with dsp and dwh as postgres datasources,
> {code:sql}
> select * from (
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> )x order by col1
> {code}
> Fails with the below errors:
> {code:java}
> Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
> SQLState: 50000
> ErrorCode: 30504
> {code}
> Where as the following query works without any problem:
> {code:sql}
> select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
> left join dwh.test_ep_dwh b on b.str=a.str
> union all
> select 2 as col1, 'abc' as col2
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5437) ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
by sameer P (JIRA)
sameer P created TEIID-5437:
-------------------------------
Summary: ORDER BY combined with UNION/UNION ALL fails on PostgreSQL
Key: TEIID-5437
URL: https://issues.jboss.org/browse/TEIID-5437
Project: Teiid
Issue Type: Bug
Components: Connector API, Grammar, Query Engine
Reporter: sameer P
Assignee: Barry LaFond
Priority: Blocker
Combining union all and order by does not work when the query is pushed down to PostgreSQL.
The following query with dsp and dwh as postgres datasources,
{code:sql}
select * from (
select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
left join dwh.test_ep_dwh b on b.str=a.str
union all
select 2 as col1, 'abc' as col2
)x order by col1
{code}
Fails with the below errors:
{code:java}
Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 dsp_VDB_ID_1: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."str" AS c_0 FROM "public"."test_ep_ds" AS g_0 ORDER BY b."i" LIMIT 100]
SQLState: 50000
ErrorCode: 30504
{code}
Where as the following query works without any problem:
{code:sql}
select b.i as col1, 'def' as col2 from dsp.test_ep_ds a
left join dwh.test_ep_dwh b on b.str=a.str
union all
select 2 as col1, 'abc' as col2
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months
[JBoss JIRA] (TEIID-5434) count(*) returns different nr of rows compared to normal select
by Bram Gadeyne (JIRA)
[ https://issues.jboss.org/browse/TEIID-5434?page=com.atlassian.jira.plugin... ]
Bram Gadeyne commented on TEIID-5434:
-------------------------------------
I can confirm that this is resolved in the snapshot build of 10.3.4
Thank you!
> count(*) returns different nr of rows compared to normal select
> ---------------------------------------------------------------
>
> Key: TEIID-5434
> URL: https://issues.jboss.org/browse/TEIID-5434
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 10.3.3
> Reporter: Bram Gadeyne
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 11.1, 10.3.4, 11.0.2
>
> Attachments: count_plan.txt, count_plan_debug_log.txt, count_plan_text.txt, select_plan.txt, select_plan_debug_log.txt, select_plan_text.txt
>
>
> Normal select return 162175 rows:
> {code:sql}
> select pa.ICUSessionID,11074, obr.DateTime, obr.varvalue, true, 15001866
> from tv_retrieve_observrec obr
> join kd_matric.ExtrPatICUAdmissions epa on epa.PatientID = obr.admissionid
> join kd_matric.PatICUAdmissions pa on pa.ICUSessionID = epa.ICUSessionID and pa.BatchID < 1152
> where obr.VariableID = 15001866;
> {code}
> count query return a count of 11573
> {code:sql}
> select count(*)
> from tv_retrieve_observrec obr
> join kd_matric.ExtrPatICUAdmissions epa on epa.PatientID = obr.admissionid
> join kd_matric.PatICUAdmissions pa on pa.ICUSessionID = epa.ICUSessionID and pa.BatchID < 1152
> where obr.VariableID = 15001866;
> {code}
> This was detected on a snapshot release of 10.3.3
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months