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

Use a Factory in MaterializationService to create tables

    Details

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

      Description

      Follow up of this conversation

      There are two tasks:

      1. Use a Factory to create tables that represent a materialized view.
      2. Add an entry to the schema only if a materialized table was created in defineMaterialization.

      I'll open a WIP progress soon.

      1. was easy to implement.
      2. is proving to be hard because rest of the code requires a CalciteSchema.TableEntry object which is available only when a table is added to schema. I dont know how to get an object for an existing entry.

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        In CalciteSchema, I think you can change getTable to return a TableEntry rather than a Pair<String, Table>, and fix up uses of that method. If the approach is successful you should also modify getTableBasedOnNullaryFunction and getTableEntryBySql in the same way. It breaks backwards compatibility, but CalciteSchema is not a public API.

        Show
        julianhyde Julian Hyde added a comment - In CalciteSchema, I think you can change getTable to return a TableEntry rather than a Pair<String, Table>, and fix up uses of that method. If the approach is successful you should also modify getTableBasedOnNullaryFunction and getTableEntryBySql in the same way. It breaks backwards compatibility, but CalciteSchema is not a public API.
        Hide
        vrajat Rajat Venkatesh added a comment -

        I'll give that a try. I had added a new function. I'll change getTable
        instead

        Show
        vrajat Rajat Venkatesh added a comment - I'll give that a try. I had added a new function. I'll change getTable instead
        Hide
        vrajat Rajat Venkatesh added a comment -

        Created a PR: https://github.com/apache/incubator-calcite/pull/90

        On Wed, Jun 3, 2015 at 12:16 PM Rajat Venkatesh <

        Show
        vrajat Rajat Venkatesh added a comment - Created a PR: https://github.com/apache/incubator-calcite/pull/90 On Wed, Jun 3, 2015 at 12:16 PM Rajat Venkatesh <
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/8b53dc49 . Thanks, Rajat!
        Hide
        jnadeau Jacques Nadeau added a comment -

        Resolved in release 1.4.0-incubating (2015-08-23)

        Show
        jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            vrajat Rajat Venkatesh
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development