You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "jhkcool (Jira)" <ji...@apache.org> on 2021/09/27 06:13:00 UTC

[jira] [Created] (CALCITE-4807) Materialized views do not support SQL with limit and order by well

jhkcool created CALCITE-4807:
--------------------------------

             Summary: 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


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.



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