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

Add RelMetadataProvider parameter to standard planner Programs

    Details

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

      Description

      The Programs class has a static method standard() used by the default Calcite driver. So far Calcite-Phoenix is using the same sql prepare logic with some slight customization, like plugging in a set of its own rules. The static standard(), though, does not work properly for Phoenix since some sub-programs it returns are initiated with the default RelMetadataProvider while Phoenix needs to plug-in its own, otherwise it just could not work.

        /** Program that converts filters and projects to {@link Calc}s. */
        public static final Program CALC_PROGRAM =
            hep(CALC_RULES, true, new DefaultRelMetadataProvider());
      
        /** Program that expands sub-queries. */
        public static final Program SUB_QUERY_PROGRAM =
            hep(
                ImmutableList.of((RelOptRule) SubQueryRemoveRule.FILTER,
                    SubQueryRemoveRule.PROJECT,
                    SubQueryRemoveRule.JOIN), true, new DefaultRelMetadataProvider());
      

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.6.0 (2016-01-22).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.6.0 (2016-01-22).
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/af77ec86 .
          Hide
          maryannxue Maryann Xue added a comment -

          Could you please take a look at this one, Julian Hyde? Not sure if I should even remove or deprecate CALC_PROGRAM and SUBQUERY_PROGRAM as they are not used anywhere within Calcite after this change.

          Show
          maryannxue Maryann Xue added a comment - Could you please take a look at this one, Julian Hyde ? Not sure if I should even remove or deprecate CALC_PROGRAM and SUBQUERY_PROGRAM as they are not used anywhere within Calcite after this change.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development