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

    https://github.com/apache/carbondata/pull/2883#discussion_r229628306
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentPropertiesAndSchemaHolder.java
 ---
    @@ -350,47 +358,77 @@ public SegmentProperties getSegmentProperties() {
           return columnCardinality;
         }
     
    -    public CarbonRowSchema[] getTaskSummarySchema(boolean 
storeBlockletCount,
    +    public CarbonRowSchema[] getTaskSummarySchemaForBlock(boolean 
storeBlockletCount,
             boolean filePathToBeStored) throws MemoryException {
    -      if (null == taskSummarySchema) {
    +      if (null == taskSummarySchemaForBlock) {
             synchronized (taskSchemaLock) {
    -          if (null == taskSummarySchema) {
    -            taskSummarySchema = SchemaGenerator
    +          if (null == taskSummarySchemaForBlock) {
    +            taskSummarySchemaForBlock = SchemaGenerator
                     .createTaskSummarySchema(segmentProperties, 
minMaxCacheColumns, storeBlockletCount,
                         filePathToBeStored);
               }
             }
           }
    -      return taskSummarySchema;
    +      return taskSummarySchemaForBlock;
    +    }
    +
    +    public CarbonRowSchema[] getTaskSummarySchemaForBlocklet(boolean 
storeBlockletCount,
    +        boolean filePathToBeStored) throws MemoryException {
    +      if (null == taskSummarySchemaForBlocklet) {
    +        synchronized (taskSchemaLock) {
    +          if (null == taskSummarySchemaForBlocklet) {
    +            taskSummarySchemaForBlocklet = SchemaGenerator
    +                .createTaskSummarySchema(segmentProperties, 
minMaxCacheColumns, storeBlockletCount,
    +                    filePathToBeStored);
    +          }
    +        }
    +      }
    +      return taskSummarySchemaForBlocklet;
         }
     
         public CarbonRowSchema[] getBlockFileFooterEntrySchema() {
    -      return getOrCreateFileFooterEntrySchema(true);
    +      if (null == fileFooterEntrySchemaForBlock) {
    +        synchronized (fileFooterSchemaLock) {
    +          if (null == fileFooterEntrySchemaForBlock) {
    +            fileFooterEntrySchemaForBlock =
    +                SchemaGenerator.createBlockSchema(segmentProperties, 
minMaxCacheColumns);
    +          }
    +        }
    +      }
    +      return fileFooterEntrySchemaForBlock;
         }
     
         public CarbonRowSchema[] getBlockletFileFooterEntrySchema() {
    -      return getOrCreateFileFooterEntrySchema(false);
    +      if (null == fileFooterEntrySchemaForBlocklet) {
    +        synchronized (fileFooterSchemaLock) {
    +          if (null == fileFooterEntrySchemaForBlocklet) {
    +            fileFooterEntrySchemaForBlocklet =
    +                SchemaGenerator.createBlockletSchema(segmentProperties, 
minMaxCacheColumns);
    +          }
    +        }
    +      }
    +      return fileFooterEntrySchemaForBlocklet;
         }
     
         public List<CarbonColumn> getMinMaxCacheColumns() {
           return minMaxCacheColumns;
         }
     
         private CarbonRowSchema[] getOrCreateFileFooterEntrySchema(boolean 
isCacheLevelBlock) {
    --- End diff --
    
    Remove this method it is not required


---

Reply via email to