You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by jackylk <gi...@git.apache.org> on 2017/04/11 03:45:36 UTC

[GitHub] incubator-carbondata pull request #659: [CARBONDATA-781] Store one SegmentPr...

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

    https://github.com/apache/incubator-carbondata/pull/659#discussion_r110810313
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/SegmentTaskIndexStore.java ---
    @@ -338,14 +339,28 @@ private synchronized Object addAndGetSegmentLock(String segmentId) {
        * @throws IOException
        */
       private AbstractIndex loadBlocks(TaskBucketHolder taskBucketHolder,
    -      List<TableBlockInfo> tableBlockInfoList, AbsoluteTableIdentifier tableIdentifier)
    +      List<TableBlockInfo> tableBlockInfoList, AbsoluteTableIdentifier tableIdentifier,
    +      TableSegmentUniqueIdentifier tableSegmentUniqueIdentifier)
           throws IOException {
         // all the block of one task id will be loaded together
         // so creating a list which will have all the data file meta data to of one task
         List<DataFileFooter> footerList = CarbonUtil
             .readCarbonIndexFile(taskBucketHolder.taskNo, taskBucketHolder.bucketNumber,
                 tableBlockInfoList, tableIdentifier);
    -    AbstractIndex segment = new SegmentTaskIndex();
    +
    +    if (null == tableSegmentUniqueIdentifier.getSegmentProperties()) {
    +      // create a metadata details
    +      // this will be useful in query handling
    +      // all the data file metadata will have common segment properties we
    +      // can use first one to get create the segment properties
    +      SegmentProperties segmentProperties =
    +          new SegmentProperties(footerList.get(0).getColumnInTable(),
    --- End diff --
    
    I think the hashmap approach is OK. You can keep a hashmap in this class and store the mapping from a key (calculated from schema) to the SegmentProperties object.


---
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.
---