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

Fix join/aggregate rewriting rule when same table is referenced more than once

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.13.0
    • Component/s: core
    • Labels:
      None

      Description

      Bug in new materialized view rewriting rule initially caught by coverity scan:

      /core/src/main/java/org/apache/calcite/rel/rules/AbstractMaterializedViewRule.java: 950 in org.apache.calcite.rel.rules.AbstractMaterializedViewRule.generateTableMappings(com.google.common.collect.Multimap)()
      944         }
      945         result.add(HashBiMap.<RelTableRef, RelTableRef>create());
      946         for (Entry<RelTableRef, Collection<RelTableRef>> e : multiMapTables.asMap().entrySet()) {
      947           boolean added = false;
      948           for (RelTableRef target : e.getValue()) {
      949             if (added) {
          CID 144066:  API usage errors  (INVALIDATE_ITERATOR)
          Attempting to obtain another element from "result" after it's been modified.
      950               for (BiMap<RelTableRef, RelTableRef> m : result) {
      951                 final BiMap<RelTableRef, RelTableRef> newM =
      952                     HashBiMap.<RelTableRef, RelTableRef>create(m);
      953                 newM.put(e.getKey(), target);
      954                 result.add(newM);
      955               }
      

        Issue Links

          Activity

          Show
          jcamachorodriguez Jesus Camacho Rodriguez added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/6f07293 . Thanks for reporting Julian Hyde .
          Hide
          jcamachorodriguez Jesus Camacho Rodriguez added a comment -

          Resolved in release 1.13.0 (2017-06-26).

          Show
          jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.13.0 (2017-06-26).

            People

            • Assignee:
              jcamachorodriguez Jesus Camacho Rodriguez
              Reporter:
              jcamachorodriguez Jesus Camacho Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development