[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 resolved TEIID-5569.
-----------------------------------
Resolution: Done
Updated the logic to look for the usage of problematic aggregate functions in the subquery select / having clauses.
> 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: 11.1.2, 12.0, 11.2.2
>
>
> 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)
5 years, 6 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:
----------------------------------
Fix Version/s: 11.1.2
11.2.2
> 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: 11.1.2, 12.0, 11.2.2
>
>
> 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)
5 years, 6 months
[JBoss JIRA] (TEIID-5525) add a flag to revert to the prior behavior (TEIID-4557)
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5525?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5525:
---------------------------------------
> Do I understand correctly that I can make some more tweaks to the value and get a situation when TEIID31292 is logged but TEIID31262 is not thrown?
Yes, you can unset it entirely or just set it higher.
> About my other concern, should enforceSingleMaxBufferSizeEstimate=false turn also the TEIID31262 into a warning?
No. TEIID31262 is already controlled by the maxSessionBufferSizeEstimate value, there's no need to override that with another setting.
> add a flag to revert to the prior behavior (TEIID-4557)
> -------------------------------------------------------
>
> Key: TEIID-5525
> URL: https://issues.jboss.org/browse/TEIID-5525
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.14.6_4, 8.12.15.6_4
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0.3, 11.1.2, 12.0, 11.2.1, 8.12.17.6_4
>
>
> Several customers are seeing errors[1] after https://issues.jboss.org/browse/TEIID-4557 was implemented and generally have to drop the max-active-plans to 1 for their queries to succeed. Can a flag be added to revert to the behavior prior to TEIID-4557?
> [1]
> ERROR [org.teiid.PROCESSOR] TEIID30019 Unexpected exception for request rcX003UtoyEg.0: org.teiid.core.TeiidComponentException: TEIID31261 Max estimated size 4,963,628,721 for a single operation/table id 85 has been exceeded. The server may need to increase the amount of disk or memory available, or decrease the number of max active plans.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5525) add a flag to revert to the prior behavior (TEIID-4557)
by Andrej Šmigala (Jira)
[ https://issues.jboss.org/browse/TEIID-5525?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-5525:
---------------------------------------
> Only if org.teiid.maxSessionBufferSizeEstimate is set to a low enough value. If it is not set, or sufficiently high, then TEIID31262 will not be thrown.
so the way we wrote the test for TEIID-4557 is that we tweaked the value of maxSessionBufferSizeEstimate, a particular value resulted in TEIID31261, a higher value resulted in TEIID31262 and a yet higher value resulted in no error being thrown.
Do I understand correctly that I can make some more tweaks to the value and get a situation when TEIID31292 is logged but TEIID31262 is not thrown?
About my other concern, should enforceSingleMaxBufferSizeEstimate=false turn also the TEIID31262 into a warning?
> add a flag to revert to the prior behavior (TEIID-4557)
> -------------------------------------------------------
>
> Key: TEIID-5525
> URL: https://issues.jboss.org/browse/TEIID-5525
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.14.6_4, 8.12.15.6_4
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0.3, 11.1.2, 12.0, 11.2.1, 8.12.17.6_4
>
>
> Several customers are seeing errors[1] after https://issues.jboss.org/browse/TEIID-4557 was implemented and generally have to drop the max-active-plans to 1 for their queries to succeed. Can a flag be added to revert to the behavior prior to TEIID-4557?
> [1]
> ERROR [org.teiid.PROCESSOR] TEIID30019 Unexpected exception for request rcX003UtoyEg.0: org.teiid.core.TeiidComponentException: TEIID31261 Max estimated size 4,963,628,721 for a single operation/table id 85 has been exceeded. The server may need to increase the amount of disk or memory available, or decrease the number of max active plans.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5359) Resultset metadata defaults to case insensitive
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5359?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5359:
---------------------------------------
> do I understand correctly that this should affect the result set metadata for string columns?
Yes, but it needs to be clarified that this affected "default" metadata - that is for non-column expressions. Things like constants or complex expressions - then the metadata was generated only on the type.
> Resultset metadata defaults to case insensitive
> -----------------------------------------------
>
> Key: TEIID-5359
> URL: https://issues.jboss.org/browse/TEIID-5359
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0, 8.12.17.6_4
>
>
> MetaDataProcessor.getDefaultColumn uses case_sensitive false - which is not correct as Teiid treats all strings as case sensitive by default. Having the default as true for non-character columns is also not harmful.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5525) add a flag to revert to the prior behavior (TEIID-4557)
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIID-5525?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5525:
---------------------------------------
> However, immediately after that warning, TEIID31262 is thrown.
Only if org.teiid.maxSessionBufferSizeEstimate is set to a low enough value. If it is not set, or sufficiently high, then TEIID31262 will not be thrown.
> add a flag to revert to the prior behavior (TEIID-4557)
> -------------------------------------------------------
>
> Key: TEIID-5525
> URL: https://issues.jboss.org/browse/TEIID-5525
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.14.6_4, 8.12.15.6_4
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0.3, 11.1.2, 12.0, 11.2.1, 8.12.17.6_4
>
>
> Several customers are seeing errors[1] after https://issues.jboss.org/browse/TEIID-4557 was implemented and generally have to drop the max-active-plans to 1 for their queries to succeed. Can a flag be added to revert to the behavior prior to TEIID-4557?
> [1]
> ERROR [org.teiid.PROCESSOR] TEIID30019 Unexpected exception for request rcX003UtoyEg.0: org.teiid.core.TeiidComponentException: TEIID31261 Max estimated size 4,963,628,721 for a single operation/table id 85 has been exceeded. The server may need to increase the amount of disk or memory available, or decrease the number of max active plans.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5525) add a flag to revert to the prior behavior (TEIID-4557)
by Andrej Šmigala (Jira)
[ https://issues.jboss.org/browse/TEIID-5525?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-5525:
---------------------------------------
[~shawkins] running the tests we have for TEIID-4557, I see that TEIID31261 is no longer thrown and is instead logged as a warning (TEIID31292).
However, immediately after that warning, TEIID31262 _is_ thrown. Is this a problem in the test (previously hidden by the fact that we would not get that far), or does it always occur? It makes sense to me that running out of space for single operation (TEIID31261) would automatically result in running out of space for the whole session (TEIID31262).
Also, the test that specifically tries to get TEIID31262 to throw succeeds - i. e. TEIID31262 is still thrown, not logged as a warning. Shouldn't that also be replaced by a warning by default (as TEIID31262 was also part of the changes for TEIID-4557).
> add a flag to revert to the prior behavior (TEIID-4557)
> -------------------------------------------------------
>
> Key: TEIID-5525
> URL: https://issues.jboss.org/browse/TEIID-5525
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.14.6_4, 8.12.15.6_4
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0.3, 11.1.2, 12.0, 11.2.1, 8.12.17.6_4
>
>
> Several customers are seeing errors[1] after https://issues.jboss.org/browse/TEIID-4557 was implemented and generally have to drop the max-active-plans to 1 for their queries to succeed. Can a flag be added to revert to the behavior prior to TEIID-4557?
> [1]
> ERROR [org.teiid.PROCESSOR] TEIID30019 Unexpected exception for request rcX003UtoyEg.0: org.teiid.core.TeiidComponentException: TEIID31261 Max estimated size 4,963,628,721 for a single operation/table id 85 has been exceeded. The server may need to increase the amount of disk or memory available, or decrease the number of max active plans.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5359) Resultset metadata defaults to case insensitive
by Andrej Šmigala (Jira)
[ https://issues.jboss.org/browse/TEIID-5359?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-5359:
---------------------------------------
[~shawkins] do I understand correctly that this should affect the result set metadata for string columns?
I have a view with string column and no options on that column, then issuing {code:sql}SELECT col_default FROM View.c1{code} and running
{code:java}resultSet.getMetaData().isCaseSensitive(1){code}
returns true even on DV 6.4.5
> Resultset metadata defaults to case insensitive
> -----------------------------------------------
>
> Key: TEIID-5359
> URL: https://issues.jboss.org/browse/TEIID-5359
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0, 8.12.17.6_4
>
>
> MetaDataProcessor.getDefaultColumn uses case_sensitive false - which is not correct as Teiid treats all strings as case sensitive by default. Having the default as true for non-character columns is also not harmful.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months
[JBoss JIRA] (TEIID-5361) Column metadata with set queries only reflects projected branch
by Johnathon Lee (Jira)
[ https://issues.jboss.org/browse/TEIID-5361?page=com.atlassian.jira.plugin... ]
Johnathon Lee updated TEIID-5361:
---------------------------------
Fix Version/s: 8.12.17.6_4
> Column metadata with set queries only reflects projected branch
> ---------------------------------------------------------------
>
> Key: TEIID-5361
> URL: https://issues.jboss.org/browse/TEIID-5361
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Major
> Fix For: 11.0, 8.12.17.6_4
>
>
> The logic in the MetaDataProcessor only considers the projected branch when determining attributes beyond type, thus it may not accurately represent the expected results.
> We should also look at returning metadata that is more specific to literal values. For example:
> select 'a'
> would return the generic type metadata for 'a', rather than a more specific length.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 6 months