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

Haisheng Yuan resolved CALCITE-3928.
------------------------------------
    Fix Version/s: 1.23.0
       Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/24dd26640db01114c6931d6615b90a63969ffc42],
 thanks for the PR, [~xzh_dz]!

> Canonicalization doesn't do field trimming before materialized view matching
> ----------------------------------------------------------------------------
>
>                 Key: CALCITE-3928
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3928
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jin Xing
>            Priority: Major
>              Labels: materializedviews
>             Fix For: 1.23.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> If we have query and materialized view as below:
> {code:java}
> query:
> LogicalAggregate(group=[{4}], agg#0=[COUNT($3)])
>   LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], SAL=[$5], DEPTNO=[$7])
>     LogicalTableScan(table=[[scott, EMP]])
> mv logic:
> LogicalAggregate(group=[{1}], agg#0=[COUNT($0)])
>   LogicalProject(SAL=[$5], DEPTNO=[$7])
>     LogicalTableScan(table=[[scott, EMP]])
> {code}
> The semantics of query and mv logic are the same. Materialized view matching 
> failed, because field trimming is not done when canonicalizing the plans.
> Currently Calcite does field trimming  when convert sql to rel. But my 
> company's internal system does materialization detection – – generates & 
> transforms & stores the RelNode.
> Shall we add the field trimming when canonicalizing materialized view logic?
>  



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

Reply via email to