[
https://issues.jboss.org/browse/TEIID-5408?page=com.atlassian.jira.plugin...
]
Ivan Semenov commented on TEIID-5408:
-------------------------------------
For the given SQL the issue is reproducible only if translator supports InlineViews .
InlineViews property affects location of Access node in the plan hierarchy.
See below where Access is placed by RaiseAccess rule execution with a translator
supporting inline views:
{noformat}
BEFORE RaiseAccess
Project(groups=[w], props={PROJECT_COLS=[timestampdiff(SQL_TSI_HOUR, w.ObsoleteDate,
w.storn) AS diff, CASE WHEN (w.UnitMeasureCode = 'platnosci') OR
(w.UnitMeasureCode LIKE '%PayU - szybkie%') THEN 'PAYU' ELSE ''
END AS payu, CASE WHEN w.UnitMeasureCode IN ('moneyorder', 'Przelew
bankowy') THEN 'przelew' ELSE '' END AS przelew], OUTPUT_COLS=null})
Source(groups=[w], props={NESTED_COMMAND=SELECT anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.gcol1 AS UnitMeasureCode, anon_grp0.agg0 AS storn FROM nw.billofmaterials GROUP
BY nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode,
SYMBOL_MAP={w.ObsoleteDate=anon_grp0.gcol0, w.storn=anon_grp0.agg0,
w.UnitMeasureCode=anon_grp0.gcol1}, OUTPUT_COLS=null})
Project(groups=[anon_grp0], props={PROJECT_COLS=[anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.agg0 AS storn, anon_grp0.gcol1 AS UnitMeasureCode], OUTPUT_COLS=null})
Group(groups=[nw.billofmaterials, anon_grp0],
props={GROUP_COLS=[nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode],
SYMBOL_MAP={anon_grp0.gcol0=nw.billofmaterials.ObsoleteDate,
anon_grp0.gcol1=nw.billofmaterials.UnitMeasureCode,
anon_grp0.agg0=MIN(nw.billofmaterials.ModifiedDate)}, OUTPUT_COLS=null})
Access(groups=[nw.billofmaterials], props={SOURCE_HINT=null, MODEL_ID=Schema
name=nw, nameInSource=null, uuid=tid:d0a40034fb62, OUTPUT_COLS=null})
Source(groups=[nw.billofmaterials], props={OUTPUT_COLS=null})
AFTER RaiseAccess
Project(groups=[w], props={PROJECT_COLS=[timestampdiff(SQL_TSI_HOUR, w.ObsoleteDate,
w.storn) AS diff, CASE WHEN (w.UnitMeasureCode = 'platnosci') OR
(w.UnitMeasureCode LIKE '%PayU - szybkie%') THEN 'PAYU' ELSE ''
END AS payu, CASE WHEN w.UnitMeasureCode IN ('moneyorder', 'Przelew
bankowy') THEN 'przelew' ELSE '' END AS przelew], OUTPUT_COLS=null})
Access(groups=[w], props={SOURCE_HINT=null, MODEL_ID=Schema name=nw, nameInSource=null,
uuid=tid:d0a40034fb62, OUTPUT_COLS=null})
Source(groups=[w], props={NESTED_COMMAND=SELECT anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.gcol1 AS UnitMeasureCode, anon_grp0.agg0 AS storn FROM nw.billofmaterials GROUP
BY nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode,
SYMBOL_MAP={w.ObsoleteDate=anon_grp0.gcol0, w.storn=anon_grp0.agg0,
w.UnitMeasureCode=anon_grp0.gcol1}, OUTPUT_COLS=null, INLINE_VIEW=true})
Project(groups=[anon_grp0], props={PROJECT_COLS=[anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.agg0 AS storn, anon_grp0.gcol1 AS UnitMeasureCode], OUTPUT_COLS=null})
Group(groups=[nw.billofmaterials, anon_grp0],
props={GROUP_COLS=[nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode],
SYMBOL_MAP={anon_grp0.gcol0=nw.billofmaterials.ObsoleteDate,
anon_grp0.gcol1=nw.billofmaterials.UnitMeasureCode,
anon_grp0.agg0=MIN(nw.billofmaterials.ModifiedDate)}, OUTPUT_COLS=null})
Source(groups=[nw.billofmaterials], props={OUTPUT_COLS=null})
{noformat}
and this is where Access node is placed when translator doesn't support InlineViews
{noformat}
BEFORE RaiseAccess
Project(groups=[w], props={PROJECT_COLS=[timestampdiff(SQL_TSI_HOUR, w.ObsoleteDate,
w.storn) AS diff, CASE WHEN (w.UnitMeasureCode = 'platnosci') OR
(w.UnitMeasureCode LIKE '%PayU - szybkie%') THEN 'PAYU' ELSE ''
END AS payu, CASE WHEN w.UnitMeasureCode IN ('moneyorder', 'Przelew
bankowy') THEN 'przelew' ELSE '' END AS przelew], OUTPUT_COLS=null})
Source(groups=[w], props={NESTED_COMMAND=SELECT anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.gcol1 AS UnitMeasureCode, anon_grp0.agg0 AS storn FROM nw.billofmaterials GROUP
BY nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode,
SYMBOL_MAP={w.ObsoleteDate=anon_grp0.gcol0, w.storn=anon_grp0.agg0,
w.UnitMeasureCode=anon_grp0.gcol1}, OUTPUT_COLS=null})
Project(groups=[anon_grp0], props={PROJECT_COLS=[anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.agg0 AS storn, anon_grp0.gcol1 AS UnitMeasureCode], OUTPUT_COLS=null})
Group(groups=[nw.billofmaterials, anon_grp0],
props={GROUP_COLS=[nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode],
SYMBOL_MAP={anon_grp0.gcol0=nw.billofmaterials.ObsoleteDate,
anon_grp0.gcol1=nw.billofmaterials.UnitMeasureCode,
anon_grp0.agg0=MIN(nw.billofmaterials.ModifiedDate)}, OUTPUT_COLS=null})
Access(groups=[nw.billofmaterials], props={SOURCE_HINT=null, MODEL_ID=Schema
name=nw, nameInSource=null, uuid=tid:d0a40034fb62, OUTPUT_COLS=null})
Source(groups=[nw.billofmaterials], props={OUTPUT_COLS=null})
AFTER RaiseAccess
Project(groups=[w], props={PROJECT_COLS=[timestampdiff(SQL_TSI_HOUR, w.ObsoleteDate,
w.storn) AS diff, CASE WHEN (w.UnitMeasureCode = 'platnosci') OR
(w.UnitMeasureCode LIKE '%PayU - szybkie%') THEN 'PAYU' ELSE ''
END AS payu, CASE WHEN w.UnitMeasureCode IN ('moneyorder', 'Przelew
bankowy') THEN 'przelew' ELSE '' END AS przelew], OUTPUT_COLS=null})
Source(groups=[w], props={NESTED_COMMAND=SELECT anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.gcol1 AS UnitMeasureCode, anon_grp0.agg0 AS storn FROM nw.billofmaterials GROUP
BY nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode,
SYMBOL_MAP={w.ObsoleteDate=anon_grp0.gcol0, w.storn=anon_grp0.agg0,
w.UnitMeasureCode=anon_grp0.gcol1}, OUTPUT_COLS=null})
Access(groups=[nw.billofmaterials, anon_grp0], props={SOURCE_HINT=null,
MODEL_ID=Schema name=nw, nameInSource=null, uuid=tid:d0a40034fb62, OUTPUT_COLS=null})
Project(groups=[anon_grp0], props={PROJECT_COLS=[anon_grp0.gcol0 AS ObsoleteDate,
anon_grp0.agg0 AS storn, anon_grp0.gcol1 AS UnitMeasureCode], OUTPUT_COLS=null})
Group(groups=[nw.billofmaterials, anon_grp0],
props={GROUP_COLS=[nw.billofmaterials.ObsoleteDate, nw.billofmaterials.UnitMeasureCode],
SYMBOL_MAP={anon_grp0.gcol0=nw.billofmaterials.ObsoleteDate,
anon_grp0.gcol1=nw.billofmaterials.UnitMeasureCode,
anon_grp0.agg0=MIN(nw.billofmaterials.ModifiedDate)}, OUTPUT_COLS=null})
Source(groups=[nw.billofmaterials], props={OUTPUT_COLS=null})
{noformat}
Position of nodes in plan affect flow in method
{{RuleAssignOutputElements#collectRequiredInputSymbols}} and
{{RuleAssignOutputElements#pushProjection}} (note {{requiredSymbols.add(ss)}} invocation)
Complex Inline View queries fail with IndexOutOfBoundsException
---------------------------------------------------------------
Key: TEIID-5408
URL:
https://issues.jboss.org/browse/TEIID-5408
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 10.2.1
Environment: teiid-10.2.1 on WildFly Full 11.0.0.Final (WildFly Core
3.0.8.Final)
Reporter: Ivan Semenov
Assignee: Steven Hawkins
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)