Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3920

Don't merge same dictionaries when merge dictionary

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: v2.5.2
    • Fix Version/s: None
    • Component/s: Others
    • Labels:
      None

      Description

      Hi team:
      I found DictionaryManager will pass some dictionaries to DictionaryGenerator to merge them when there is different one among them. But If there are 3 dictionaries

      {Dic1, Dic1, Dic2}

      in 3 segments, kylin may don't need to merge Dic1 and Dic1, which won't add same value into new dictionary twice.
      If I misunderstand the merge job logic, please feel free to correct me!
      Here is the code snapshot at DictionaryManager.java:251

      ```
      boolean identicalSourceDicts = true;
      for (int i = 1; i < dicts.size(); ++i) {
      if (!dicts.get(0).getDictionaryObject().equals(dicts.get.getDictionaryObject()))

      { identicalSourceDicts = false; break; }

      }

      if (identicalSourceDicts)

      { logger.info("Use one of the merging dictionaries directly"); return dicts.get(0); }

      else

      { Dictionary<String> newDict = DictionaryGenerator.mergeDictionaries(DataType.getType(newDictInfo.getDataType()), dicts); return trySaveNewDict(newDict, newDictInfo); }

      ```

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              simpleyuzhang Yuzhang QIU
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: