carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manishgupta88 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1097: [WIP] [CARBONDATA-1229] Skip dictionary and d...
Date Tue, 27 Jun 2017 06:39:17 GMT
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1097#discussion_r124188599
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java
---
    @@ -40,21 +42,21 @@
       @Override
       public Integer generateKey(DictionaryMessage value)
           throws DictionaryGenerationException {
    -    TableDictionaryGenerator generator = tableMap.get(value.getTableUniqueName());
    -    assert generator != null : "Table initialization for generator is not done";
    +    TableDictionaryGenerator generator = tableMap.get(value.getTableUniqueId());
    +    if (generator == null) {
    +      throw new DictionaryGenerationException("Table Not Found");
    +    }
         return generator.generateKey(value);
       }
     
    -  public void initializeGeneratorForTable(DictionaryMessage key) {
    -    CarbonMetadata metadata = CarbonMetadata.getInstance();
    -    CarbonTable carbonTable = metadata.getCarbonTable(key.getTableUniqueName());
    +  public void initializeGeneratorForTable(DictionaryMessage key, CarbonTable carbonTable)
{
         CarbonDimension dimension = carbonTable.getPrimitiveDimensionByName(
                 key.getTableUniqueName(), key.getColumnName());
         // initialize TableDictionaryGenerator first
         if (tableMap.get(key.getTableUniqueName()) == null) {
           synchronized (tableMap) {
             if (tableMap.get(key.getTableUniqueName()) == null) {
    -          tableMap.put(key.getTableUniqueName(), new TableDictionaryGenerator(dimension));
    +          tableMap.put(key.getTableUniqueName(), new TableDictionaryGenerator(dimension,
carbonTable));
    --- End diff --
    
    make unique name as dbName_tableID


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message