[JBoss JIRA] (TEIID-3295) Change subqueryUnnestDefault to true
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3295?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3295.
-----------------------------------
Resolution: Done
Updated the default to true. Also updated the hint logic to support the subquery hints in all locations. In some circumstances this can produce an undesirable plan. For example when the main part of the query needs sorting for join processing, or few subqueries will actually run - in these specific circumstances now that we have an enhanced join or minimal cardinality would indicate result in a similar or better plan with the join unnested. In general users can choose to use the no_unnest hint, but ideally we'll capture any deficiencies in the logic - which may perhaps necessitate speculative planning.
> Change subqueryUnnestDefault to true
> ------------------------------------
>
> Key: TEIID-3295
> URL: https://issues.jboss.org/browse/TEIID-3295
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Affects Versions: 8.10
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.10
>
>
> Since TEIID-2149 the scope of the property has been limited in scope and should be flipped to true to allow for more efficient planning. In the worst case users can use the NO_UNNEST hint to prevent the optimization.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3310) Nesting aliases that match the engine recontext logic can lead to naming conflicts
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3310?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3310.
-----------------------------------
Resolution: Done
Resolved by adding groups that could have been recontexted into the known set prior to RulePlaceAccess running.
> Nesting aliases that match the engine recontext logic can lead to naming conflicts
> ----------------------------------------------------------------------------------
>
> Key: TEIID-3310
> URL: https://issues.jboss.org/browse/TEIID-3310
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 7.7
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.10
>
>
> A query such as:
> select (select e4 from pm1.g1 X__1), pm1.g1.e2 from pm1.g1, /*+ makeind */ (select e1 from pm2.g1) AS X__1, (select distinct e2, e3 from pm3.g1) X__2 where pm1.g1.e3 = X__1.e1 and pm1.g1.e2 = year(X__2.e3)
> Will fail to process correctly as the X__1 and X__2 aliases are already in use, which will cause an AssertionError during processing attempting to reference X__1.e1.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3312) Subquery field giving a group by error
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3312?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3312:
---------------------------------------
You'd have to rely on the workaround for now. You can add a vote for the issue to be included then in 8.10 or 8.11.
> Subquery field giving a group by error
> --------------------------------------
>
> Key: TEIID-3312
> URL: https://issues.jboss.org/browse/TEIID-3312
> Project: Teiid
> Issue Type: Feature Request
> Reporter: Mark Tawk
> Assignee: Steven Hawkins
> Priority: Critical
>
> Hello,
> I'm using Teiid 8.9.0.Alpha2, Mysql 5.7 and mysql5 Translator
> I have query, in which i'm using a subquery field containing a criteria using a date field coming from the main query YEAR("activities"."ActivityDate").
> Teiid is forcing me to put "activities"."ActivityDate" in main query group by, while i want to group my data by YEAR("activities"."ActivityDate").
> I'm getting the following teiid error :
> TEIID30020 Processing exception for request fOwqPyy91bbL.0 'TEIID30492 [activities.ActivityDate] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'.
> Here is the query:
> select COUNT( distinct "activities"."ActEmpName") as "activities_ActEmpName"
> ,YEAR(activities.ActivityDate) as "activities_ActivityDate"
> ,(select COUNT( distinct "employees_sub"."EmpFullName") as "employees_EmpFullName"
> from "TrackerModel".tracker_datawarehouse."employees" "employees_sub"
> where ( YEAR(employees_sub.EmpHireDate) <= YEAR("activities"."ActivityDate"))
> LIMIT 0 , 1) as "SubQuery Employees"
> from "TrackerModel".tracker_datawarehouse."activities" "activities"
> group by YEAR(activities.ActivityDate)
> LIMIT 0 , 10
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3310) Nesting aliases that match the engine recontext logic can lead to naming conflicts
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3310?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-3310:
----------------------------------
Issue Type: Bug (was: Feature Request)
> Nesting aliases that match the engine recontext logic can lead to naming conflicts
> ----------------------------------------------------------------------------------
>
> Key: TEIID-3310
> URL: https://issues.jboss.org/browse/TEIID-3310
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 7.7
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.10
>
>
> A query such as:
> select (select e4 from pm1.g1 X__1), pm1.g1.e2 from pm1.g1, /*+ makeind */ (select e1 from pm2.g1) AS X__1, (select distinct e2, e3 from pm3.g1) X__2 where pm1.g1.e3 = X__1.e1 and pm1.g1.e2 = year(X__2.e3)
> Will fail to process correctly as the X__1 and X__2 aliases are already in use, which will cause an AssertionError during processing attempting to reference X__1.e1.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3312) Subquery field giving a group by error
by Mark Tawk (JIRA)
[ https://issues.jboss.org/browse/TEIID-3312?page=com.atlassian.jira.plugin... ]
Mark Tawk commented on TEIID-3312:
----------------------------------
Any hope that it will be resolved in a future teiid version or am I forced to use the workaround you suggested?
> Subquery field giving a group by error
> --------------------------------------
>
> Key: TEIID-3312
> URL: https://issues.jboss.org/browse/TEIID-3312
> Project: Teiid
> Issue Type: Feature Request
> Reporter: Mark Tawk
> Assignee: Steven Hawkins
> Priority: Critical
>
> Hello,
> I'm using Teiid 8.9.0.Alpha2, Mysql 5.7 and mysql5 Translator
> I have query, in which i'm using a subquery field containing a criteria using a date field coming from the main query YEAR("activities"."ActivityDate").
> Teiid is forcing me to put "activities"."ActivityDate" in main query group by, while i want to group my data by YEAR("activities"."ActivityDate").
> I'm getting the following teiid error :
> TEIID30020 Processing exception for request fOwqPyy91bbL.0 'TEIID30492 [activities.ActivityDate] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'.
> Here is the query:
> select COUNT( distinct "activities"."ActEmpName") as "activities_ActEmpName"
> ,YEAR(activities.ActivityDate) as "activities_ActivityDate"
> ,(select COUNT( distinct "employees_sub"."EmpFullName") as "employees_EmpFullName"
> from "TrackerModel".tracker_datawarehouse."employees" "employees_sub"
> where ( YEAR(employees_sub.EmpHireDate) <= YEAR("activities"."ActivityDate"))
> LIMIT 0 , 1) as "SubQuery Employees"
> from "TrackerModel".tracker_datawarehouse."activities" "activities"
> group by YEAR(activities.ActivityDate)
> LIMIT 0 , 10
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3312) Subquery field giving a group by error
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3312?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3312.
-----------------------------------
Resolution: Duplicate Issue
Duplicate of TEIID-1680
> Subquery field giving a group by error
> --------------------------------------
>
> Key: TEIID-3312
> URL: https://issues.jboss.org/browse/TEIID-3312
> Project: Teiid
> Issue Type: Feature Request
> Reporter: Mark Tawk
> Assignee: Steven Hawkins
> Priority: Critical
>
> Hello,
> I'm using Teiid 8.9.0.Alpha2, Mysql 5.7 and mysql5 Translator
> I have query, in which i'm using a subquery field containing a criteria using a date field coming from the main query YEAR("activities"."ActivityDate").
> Teiid is forcing me to put "activities"."ActivityDate" in main query group by, while i want to group my data by YEAR("activities"."ActivityDate").
> I'm getting the following teiid error :
> TEIID30020 Processing exception for request fOwqPyy91bbL.0 'TEIID30492 [activities.ActivityDate] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'.
> Here is the query:
> select COUNT( distinct "activities"."ActEmpName") as "activities_ActEmpName"
> ,YEAR(activities.ActivityDate) as "activities_ActivityDate"
> ,(select COUNT( distinct "employees_sub"."EmpFullName") as "employees_EmpFullName"
> from "TrackerModel".tracker_datawarehouse."employees" "employees_sub"
> where ( YEAR(employees_sub.EmpHireDate) <= YEAR("activities"."ActivityDate"))
> LIMIT 0 , 1) as "SubQuery Employees"
> from "TrackerModel".tracker_datawarehouse."activities" "activities"
> group by YEAR(activities.ActivityDate)
> LIMIT 0 , 10
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (TEIID-3312) Subquery field giving a group by error
by Mark Tawk (JIRA)
Mark Tawk created TEIID-3312:
--------------------------------
Summary: Subquery field giving a group by error
Key: TEIID-3312
URL: https://issues.jboss.org/browse/TEIID-3312
Project: Teiid
Issue Type: Feature Request
Reporter: Mark Tawk
Assignee: Steven Hawkins
Priority: Critical
Hello,
I'm using Teiid 8.9.0.Alpha2, Mysql 5.7 and mysql5 Translator
I have query, in which i'm using a subquery field containing a criteria using a date field coming from the main query YEAR("activities"."ActivityDate").
Teiid is forcing me to put "activities"."ActivityDate" in main query group by, while i want to group my data by YEAR("activities"."ActivityDate").
I'm getting the following teiid error :
TEIID30020 Processing exception for request fOwqPyy91bbL.0 'TEIID30492 [activities.ActivityDate] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'.
Here is the query:
select COUNT( distinct "activities"."ActEmpName") as "activities_ActEmpName"
,YEAR(activities.ActivityDate) as "activities_ActivityDate"
,(select COUNT( distinct "employees_sub"."EmpFullName") as "employees_EmpFullName"
from "TrackerModel".tracker_datawarehouse."employees" "employees_sub"
where ( YEAR(employees_sub.EmpHireDate) <= YEAR("activities"."ActivityDate"))
LIMIT 0 , 1) as "SubQuery Employees"
from "TrackerModel".tracker_datawarehouse."activities" "activities"
group by YEAR(activities.ActivityDate)
LIMIT 0 , 10
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months