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

Add a method in RelOptMaterializations to allow registering UnifyRule

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.28.0
    • None

    Description

      In current code of MaterializedViewSubstitutionVisitor, all matching rules are internal defined. The existing rules support the most popular scenarios. But my customers sometimes ask for the ability to self define some matching rules, thus to support some special scenarios.

      I take below example as an illustration:

      Query:
      select * from table
      where from_unixtime(_EVENT_TIME_, "yyyymmdd hh") >= "20190909 00"
      and from_unixtime(_EVENT_TIME_, "yyyymmdd hh") <= "20190909 23" ;
      
      Materialized View:
      select * from table 
      where from_unixtime(_EVENT_TIME_, "yyyymmdd") = "20190909";

      It's hard to enumerate the matching pattern for different functions in internal matching rules. We can expose a method to register new UnifyRules and allow user to extend the ability of MV matching

      Attachments

        Issue Links

          Activity

            People

              jinxing6042@126.com Jin Xing
              jinxing6042@126.com Jin Xing
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 8h 10m
                  8h 10m