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

Allow multiple providers for the same kind of metadata

    Details

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

      Description

      I am getting exceptions caused by CALCITE-604.

      The first exception I got while using PhoenixMetadataProvider was: "java.lang.IllegalArgumentException: duplicate key" in ChainedMetadataProvider.handlers(), which was caused by the use of ImmutableMap.Builder.
      According to https://groups.google.com/forum/#!topic/sakai-kernel/Kj1WRBg9pi8, in such scenarios, we should use HashMap instead.

      After fixing the above issue, I got NPE at ReflectiveRelMetadataProvider.java:278 if (RelNode.class.isAssignableFrom(relClass.getSuperclass())) {, for which I didn't know why it hadn't caused any trouble before. Since this logic wasn't really changed in CALCITE-604, I assume it went through the wrong code path.

      Looks like we should add more test cases for custom metadata in Calcite.

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Steps to reproduce from Maryann Xue:

          I've created branches with all necessary changes to reproduce the issue:

          Under phoenix-core/src/it/java/org/apache/phoenix/calcite,
          running CalciteIT.testTableScan will give the NPE in ReflectiveRelMetadataProvider.

          Show
          julianhyde Julian Hyde added a comment - Steps to reproduce from Maryann Xue : I've created branches with all necessary changes to reproduce the issue: Calcite: https://github.com/maryannxue/calcite/tree/calcite-1147 Phoenix: https://github.com/maryannxue/phoenix/tree/calcite-1147 Under phoenix-core/src/it/java/org/apache/phoenix/calcite, running CalciteIT.testTableScan will give the NPE in ReflectiveRelMetadataProvider.
          Hide
          julianhyde Julian Hyde added a comment -

          Maryann Xue, I get other errors from Hbase (and the usual heaps of useless trace output) but no NPE. Should I be initializing HBase in some way or should it be sufficient to just run the test case method?

          Show
          julianhyde Julian Hyde added a comment - Maryann Xue , I get other errors from Hbase (and the usual heaps of useless trace output) but no NPE. Should I be initializing HBase in some way or should it be sufficient to just run the test case method?
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/94f8837c .
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.7.0 (2016-03-22).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              maryannxue Maryann Xue
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development