Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1008#discussion_r121982426
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java
 ---
    @@ -169,10 +172,22 @@ public 
IncrementalColumnDictionaryGenerator(CarbonDimension dimension, int maxVa
           }
           // write value to dictionary file
           if (reverseIncrementalCache.size() > 0) {
    -        for (int index = 2; index < reverseIncrementalCache.size() + 2; 
index++) {
    -          String value = reverseIncrementalCache.get(index);
    +        String[] values = null;
    +        synchronized (lock) {
    +          // collect incremental dictionary
    +          values = new String[currentDictionarySize - maxValue];
    --- End diff --
    
    Why it is collected to temporary list, why not directly write inside lock?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to