carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1102: [CARBONDATA-1098] Change page statistics use ...
Date Fri, 07 Jul 2017 02:58:10 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1102#discussion_r126060644
  
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/TablePage.java
---
    @@ -84,19 +112,28 @@
         measurePage = new ColumnPage[model.getMeasureCount()];
         DataType[] dataTypes = model.getMeasureDataType();
         for (int i = 0; i < measurePage.length; i++) {
    -      measurePage[i] = ColumnPage.newPage(dataTypes[i], pageSize);
    +      ColumnPage page = ColumnPage.newPage(dataTypes[i], pageSize);
    +      page.setStatsCollector(PrimitivePageStatsCollector.newInstance(dataTypes[i], pageSize));
    +      measurePage[i] = page;
         }
    +    boolean hasNoDictionary = noDictDimensionPage.length > 0;
    +    this.key = new TablePageKey(pageSize, model.getMDKeyGenerator(), model.getSegmentProperties(),
    +        hasNoDictionary);
       }
     
       /**
    -   * Add one row to the internal store, it will be converted into columnar layout
    +   * Add one row to the internal store
        *
        * @param rowId Id of the input row
        * @param row   row object
        */
       public void addRow(int rowId, CarbonRow row) throws KeyGenException {
    -    // convert each column category
    +    // convert each column category, update key and stats
    +    convertToColumnar(rowId, row);
    +    key.update(rowId, row);
    --- End diff --
    
    There are 2 times mdk is generated, one inside `key.update` and and also in `convertToColumnar`.
The cost of mdk generation is high so please use it only once


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