Jesus Camacho Rodriguez created CALCITE-1767:
------------------------------------------------

             Summary: Fix join/aggregate rewriting rule when multiple 
repetitions of same table exist
                 Key: CALCITE-1767
                 URL: https://issues.apache.org/jira/browse/CALCITE-1767
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Jesus Camacho Rodriguez
            Assignee: Jesus Camacho Rodriguez
            Priority: Critical
             Fix For: 1.13.0


Initially caught by coverity scan:

{noformat}
/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               }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to