You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Kondakov (Jira)" <ji...@apache.org> on 2020/04/19 11:44:00 UTC

[jira] [Updated] (IGNITE-12914) Calcite integration: Add aggregate project merge rule to the planner

     [ https://issues.apache.org/jira/browse/IGNITE-12914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Kondakov updated IGNITE-12914:
------------------------------------
    Description: 
We need to add  next rules to planner
 * AggregateProjectMergeRule

In order to be able to make this transformation for the query:
{noformat}
"select x, sum(z), y from (\n"
    + "  select deptno as x, empno as y, sal as z, sal * 2 as zz\n"
    + "  from emp)\n"
    + "group by x, y"

BEFORE=
LogicalProject(X=[$0], EXPR$1=[$2], Y=[$1])
  LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)])
    LogicalProject(X=[$3], Y=[$0], Z=[$2])
      IgniteTableScan(table=[[PUBLIC, EMP]])

AFTER=
IgniteProject(X=[$0], EXPR$1=[$2], Y=[$1])
  IgniteProject(DEPTNO=[$1], EMPNO=[$0], EXPR$1=[$2])
    IgniteAggregate(group=[{0, 3}], EXPR$1=[SUM($2)])
      IgniteTableScan(table=[[PUBLIC, EMP]])
{noformat}
 

 

  was:
We need to add  next rules to planner
 * FilterJoinRule,
 * JoinAddRedundantSemiJoinRule,
 * SemiJoinRemoveRule

In order to be able to make this transformation for the query:
{noformat}
"select e.ename from emp e, dept d\n"
        + "where e.deptno = d.deptno"

BEFORE=
LogicalProject(ENAME=[$1])
  LogicalFilter(condition=[=($3, $5)])
    LogicalJoin(condition=[true], joinType=[inner])
      IgniteTableScan(table=[[PUBLIC, EMP]])
      IgniteTableScan(table=[[PUBLIC, DEPT]])

AFTER=
IgniteProject(ENAME=[$1])
  IgniteJoin(condition=[=($3, $5)], joinType=[inner])
    IgniteTableScan(table=[[PUBLIC, EMP]])
    IgniteTableScan(table=[[PUBLIC, DEPT]])
{noformat}
 

 


> Calcite integration: Add aggregate project merge rule to the planner
> --------------------------------------------------------------------
>
>                 Key: IGNITE-12914
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12914
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Roman Kondakov
>            Priority: Major
>
> We need to add  next rules to planner
>  * AggregateProjectMergeRule
> In order to be able to make this transformation for the query:
> {noformat}
> "select x, sum(z), y from (\n"
>     + "  select deptno as x, empno as y, sal as z, sal * 2 as zz\n"
>     + "  from emp)\n"
>     + "group by x, y"
> BEFORE=
> LogicalProject(X=[$0], EXPR$1=[$2], Y=[$1])
>   LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)])
>     LogicalProject(X=[$3], Y=[$0], Z=[$2])
>       IgniteTableScan(table=[[PUBLIC, EMP]])
> AFTER=
> IgniteProject(X=[$0], EXPR$1=[$2], Y=[$1])
>   IgniteProject(DEPTNO=[$1], EMPNO=[$0], EXPR$1=[$2])
>     IgniteAggregate(group=[{0, 3}], EXPR$1=[SUM($2)])
>       IgniteTableScan(table=[[PUBLIC, EMP]])
> {noformat}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)