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

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

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

Stamatis Zampetakis resolved CALCITE-4807.
------------------------------------------
    Fix Version/s: 1.28.0
       Resolution: Duplicate

I am closing this as duplicate. If it is not the same with CALCITE-771, CALCITE-3626 feel free to reopen. Note that in Calcite Sort and Limit are represented by the same operator ({{LogicalSort}}) at the logical level.

> 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
>    Affects Versions: 1.27.0
>            Reporter: jhkcool
>            Assignee: jhkcool
>            Priority: Major
>             Fix For: 1.28.0
>
>
> 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 t.b > 20 ORDER BY t.a  
> {code}
> This query cannot be matched.



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