Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4807

Materialized views do not support SQL with limit and order by well

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.27.0
    • 1.28.0
    • None
    • None

    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:

      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 t.b > 20 ORDER BY t.a  
      

      This query cannot be matched.

      Attachments

        Issue Links

          Activity

            People

              jhkcool jhkcool
              jhkcool jhkcool
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: