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

jhkcool updated CALCITE-4807:
-----------------------------
    Description: 
I think the current (calcite-1.27.0 tag branch version) of the materialized 
view SQL rewrite has a big problem with SQL support that contains limit and 
order by. It does not contain limit and order by and is more flexible. After 
including limit and order by, the materialized view Only when SQL and query SQL 
are exactly the same can the hit be rewritten. Has this problem been resolved 
in the latest version?
for example:
Materialization view SQL:

{code:java}
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
t.a=t1.a WHERE t.b > 10 ORDER BY t.a  
{code}

The query SQL:  

{code:java}
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
t.a=t1.a WHERE {color:red}t.b > 20{color} ORDER BY t.a  
{code}

This query cannot be matched.

  was:
I think the current (calcite-1.27.0 tag branch version) of the materialized 
view SQL rewrite has a big problem with SQL support that contains limit and 
order by. It does not contain limit and order by and is more flexible. After 
including limit and order by, the materialized view Only when SQL and query SQL 
are exactly the same can the hit be rewritten. Has this problem been resolved 
in the latest version?
for example:
Materialization view SQL:
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
t.a=t1.a WHERE t.b > 10 ORDER BY t.a  
The query SQL:  
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
t.a=t1.a WHERE {color:red}t.b > 20{color} ORDER BY t.a  
This query cannot be matched.


> Materialized views do not support SQL with limit and order by  well
> -------------------------------------------------------------------
>
>                 Key: CALCITE-4807
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4807
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: jhkcool
>            Priority: Major
>
> I think the current (calcite-1.27.0 tag branch version) of the materialized 
> view SQL rewrite has a big problem with SQL support that contains limit and 
> order by. It does not contain limit and order by and is more flexible. After 
> including limit and order by, the materialized view Only when SQL and query 
> SQL are exactly the same can the hit be rewritten. Has this problem been 
> resolved in the latest version?
> for example:
> Materialization view SQL:
> {code:java}
> SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
> t.a=t1.a WHERE t.b > 10 ORDER BY t.a  
> {code}
> The query SQL:  
> {code:java}
> SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on 
> t.a=t1.a WHERE {color:red}t.b > 20{color} ORDER BY t.a  
> {code}
> This query cannot be matched.



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

Reply via email to