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

Organize applicable materializations in reversed topological order

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      With CALCITE-890, we now try applying each materialization with all possible substitution combinations. And this works fine if all applicable materializations are independent of each other. But with dependent materializations, the order of materializations in which we perform substitution matters.
      For example, if we have tables A and B, a materialization table C that uses A, and another materialization table D that uses tables C and B. Thus, we should apply materialization C before applying materialization D.

      Right now we output the applicable materialization list as we iterate through the input materialization list which could be of random order (and it actually is). A directed graph is used to find all the applicable materializations, but we can also take advantage of this graph to organize them in the desired order.

        Activity

        Hide
        maryannxue Maryann Xue added a comment -

        Just had to reverse the direction of the graph so we'd be able to use TopologicalOrderIterator.

        Show
        maryannxue Maryann Xue added a comment - Just had to reverse the direction of the graph so we'd be able to use TopologicalOrderIterator.
        Hide
        julianhyde Julian Hyde added a comment -

        Could MaterializationTest.ListComparator be replaced with Guava's Orderings.lexicographical()?

        Show
        julianhyde Julian Hyde added a comment - Could MaterializationTest.ListComparator be replaced with Guava's Orderings.lexicographical()?
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/c48c3413 . Thanks for the patch, Maryann Xue !
        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Resolved in release 1.5.0 (2015-11-10)

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.5.0 (2015-11-10)

          People

          • Assignee:
            maryannxue Maryann Xue
            Reporter:
            maryannxue Maryann Xue
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development