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

Support for normal views to act as materialization table

    Details

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

      Description

      Currently, it seems a materialized view can only have it's materialization in a real table, although it might be nice to be able to use a view instead. Since external data stores like e.g. elasticsearch aren't might have different data representations, the mismatch has to be overcome by doing casts in a view.

        Activity

        Hide
        christian.beikov Christian Beikov added a comment -
        Show
        christian.beikov Christian Beikov added a comment - See the PR: https://github.com/apache/calcite/pull/527
        Hide
        julianhyde Julian Hyde added a comment -

        I reviewed https://github.com/apache/calcite/pull/527/commits/dbc70ef36e7364509f2ee6586515c266cbf4077a, and it looks good, except that we need a test.

        Maryann Xue can you also review? I want to make sure that dropping RelOptTable doesn't remove options later on: I don't remember whether a RelOptTable can always be re-created from its fully-qualified name.

        Show
        julianhyde Julian Hyde added a comment - I reviewed https://github.com/apache/calcite/pull/527/commits/dbc70ef36e7364509f2ee6586515c266cbf4077a , and it looks good, except that we need a test. Maryann Xue can you also review? I want to make sure that dropping RelOptTable doesn't remove options later on: I don't remember whether a RelOptTable can always be re-created from its fully-qualified name.
        Hide
        christian.beikov Christian Beikov added a comment -

        Great, as soon as you give me the ok, I'll add some tests and notify you when I'm done.

        Show
        christian.beikov Christian Beikov added a comment - Great, as soon as you give me the ok, I'll add some tests and notify you when I'm done.
        Hide
        maryannxue Maryann Xue added a comment -

        I think using qualified name instead of RelOptTable in RelOptMaterialization is fine, since the original reference to the RelOptTable is no more than getting the table's name and replacing it has no other impact. I have a couple of other minor suggestions in the PR, though.

        Show
        maryannxue Maryann Xue added a comment - I think using qualified name instead of RelOptTable in RelOptMaterialization is fine, since the original reference to the RelOptTable is no more than getting the table's name and replacing it has no other impact. I have a couple of other minor suggestions in the PR, though.
        Hide
        christian.beikov Christian Beikov added a comment -

        Maryann Xue I pushed the requested changes. Tests are coming tomorrow. Is there anything else I should take care of?

        Show
        christian.beikov Christian Beikov added a comment - Maryann Xue I pushed the requested changes. Tests are coming tomorrow. Is there anything else I should take care of?
        Hide
        maryannxue Maryann Xue added a comment -

        Thank you for your quick response, Christian Beikov! I think everything looks great now. Would you mind adding a comment for the if (existing) block, something like we try to find a prepopulated table first, and then a view?

        Show
        maryannxue Maryann Xue added a comment - Thank you for your quick response, Christian Beikov ! I think everything looks great now. Would you mind adding a comment for the if (existing) block, something like we try to find a prepopulated table first, and then a view?
        Hide
        christian.beikov Christian Beikov added a comment -

        Hey Maryann Xue I updated the PR with the comments and also added a test. Hope it's good to go like that?

        Show
        christian.beikov Christian Beikov added a comment - Hey Maryann Xue I updated the PR with the comments and also added a test. Hope it's good to go like that?
        Hide
        julianhyde Julian Hyde added a comment -

        Looks good, and you did everything Maryann Xue asked for - I'm testing now.

        Show
        julianhyde Julian Hyde added a comment - Looks good, and you did everything Maryann Xue asked for - I'm testing now.
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/6d2fc4ec ; thanks for the PR, Christian Beikov !
        Hide
        michaelmior Michael Mior added a comment -

        Resolved in release 1.14.0 (2017-10-01)

        Show
        michaelmior Michael Mior added a comment - Resolved in release 1.14.0 (2017-10-01)

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            christian.beikov Christian Beikov
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development