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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.13.0
    • core
    • 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               }
      

      Attachments

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: