[JBoss JIRA] (TEIID-5356) Infer field metadata from the source columns
by Johnathon Lee (Jira)
[ https://issues.jboss.org/browse/TEIID-5356?page=com.atlassian.jira.plugin... ]
Johnathon Lee updated TEIID-5356:
---------------------------------
Fix Version/s: 8.12.17.6_4
> Infer field metadata from the source columns
> --------------------------------------------
>
> Key: TEIID-5356
> URL: https://issues.jboss.org/browse/TEIID-5356
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Reporter: Chandra Akkinepalli
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0, 8.12.17.6_4
>
>
> This is an observation made in dynamic vdbs.
> When a view is defined without column name , data type, length as in the example below
> create view xyz as (
> select a, b, c from view_model.example
> );
> instead of inferring the column metadata from view_model, the string columns are created with length =4000, this is causing issues when querying such views from visualization tools like Tableau, these fields are forced to be converted to text and failing in the process.
> I would like to request an enhancement for dynamic vdbs to infer metadata from sources in such cases.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (TEIID-5569) Subquery unnesting with count aggregates
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5569?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5569:
----------------------------------
Summary: Subquery unnesting with count aggregates (was: Subquery unnesting with aggregates)
> Subquery unnesting with count aggregates
> ----------------------------------------
>
> Key: TEIID-5569
> URL: https://issues.jboss.org/browse/TEIID-5569
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 12.0
>
>
> A query such as:
> {code}
> SELECT pm1.g1.e1, pm1.g1.e2, /*+ MJ */ (select count(*) from pm1.g2 where e1 = pm1.g1.e1) FROM pm1.g1
> {code}
> Where the subquery contains aggregates without a group by will produce a join plan such that a group by is added to account for the projection of the e1 value for the join predicate. However that will change the value from 0 to null for counts from pm1.g2 where there are no matching rows.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (TEIID-5569) Subquery unnesting with aggregates
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5569?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5569:
---------------------------------------
We need an ifnull added in the first case:
{code}
SELECT pm1.g1.e1, pm1.g1.e2, ifnull(X__1.expr1, 0) AS expr3 FROM pm1.g1 LEFT OUTER JOIN (SELECT COUNT(*) AS expr1, e1 FROM pm1.g2 GROUP BY e1) AS X__1 ON pm1.g1.e1 = X__1.e1
{code}
In the event of usage in the where clause, the default logic of an inner join does not produce a correct result.
{code}
SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1 where e2 = /*+ MJ */ (select count(*) from pm1.g2 where e1 = pm1.g1.e1)
{code}
Actually needs a left outer join:
{code}
SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1 left outer join (SELECT COUNT(*) AS expr1, e1 FROM pm1.g2 GROUP BY e1) AS X__1 on (pm1.g1.e1 = X__1.e1) WHERE (e2 = ifnull(X__1.expr1, 0))
{code}
Things get more complicated if the projected aggregate is nested in an expression. We should dissallow that case.
> Subquery unnesting with aggregates
> ----------------------------------
>
> Key: TEIID-5569
> URL: https://issues.jboss.org/browse/TEIID-5569
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 12.0
>
>
> A query such as:
> {code}
> SELECT pm1.g1.e1, pm1.g1.e2, /*+ MJ */ (select count(*) from pm1.g2 where e1 = pm1.g1.e1) FROM pm1.g1
> {code}
> Where the subquery contains aggregates without a group by will produce a join plan such that a group by is added to account for the projection of the e1 value for the join predicate. However that will change the value from 0 to null for counts from pm1.g2 where there are no matching rows.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (TEIID-5570) xmlagg should return null rather than empty over no values
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5570?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5570:
----------------------------------
Description:
For example the query:
{code}
select xmlagg(col) from (select cast('<a></a>' as xml) as col, 1 col1) x where col1 = 2
{code}
or
{code}
select xmlagg(col) from (select cast(null as xml) as col) x
{code}
Should return null rather than an empty document.
was:
For example the query:
{code}
select xmlagg(col) from (select cast('<a></a>' as xml) as col) x
{code}
Should return null rather than an empty document.
> xmlagg should return null rather than empty over no values
> ----------------------------------------------------------
>
> Key: TEIID-5570
> URL: https://issues.jboss.org/browse/TEIID-5570
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.1.2, 12.0, 11.2.2
>
>
> For example the query:
> {code}
> select xmlagg(col) from (select cast('<a></a>' as xml) as col, 1 col1) x where col1 = 2
> {code}
> or
> {code}
> select xmlagg(col) from (select cast(null as xml) as col) x
> {code}
> Should return null rather than an empty document.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (TEIID-5570) xmlagg should return null rather than empty over no values
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5570?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5570:
----------------------------------
Description:
For example the query:
{code}
select xmlagg(col) from (select cast('<a></a>' as xml) as col) x
{code}
Should return null rather than an empty document.
was:
For example the query:
select string_agg(col, ',') from (select cast(null as string) as col) x
Should return null rather than an empty string.
> xmlagg should return null rather than empty over no values
> ----------------------------------------------------------
>
> Key: TEIID-5570
> URL: https://issues.jboss.org/browse/TEIID-5570
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.1.2, 12.0, 11.2.2
>
>
> For example the query:
> {code}
> select xmlagg(col) from (select cast('<a></a>' as xml) as col) x
> {code}
> Should return null rather than an empty document.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months
[JBoss JIRA] (TEIID-5570) xmlagg should return null rather than empty over no values
by Steven Hawkins (Jira)
Steven Hawkins created TEIID-5570:
-------------------------------------
Summary: xmlagg should return null rather than empty over no values
Key: TEIID-5570
URL: https://issues.jboss.org/browse/TEIID-5570
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.2, 11.1.1, 11.0.3
For example the query:
select string_agg(col, ',') from (select cast(null as string) as col) x
Should return null rather than an empty string.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 3 months