carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piaoyats <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #412: [CARBONDATA-519]Added vector reader ...
Date Thu, 15 Dec 2016 02:11:12 GMT
Github user piaoyats commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/412#discussion_r92531597
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/carbon/datastore/chunk/impl/FixedLengthDimensionDataChunk.java
---
    @@ -77,13 +79,75 @@ public FixedLengthDimensionDataChunk(byte[] dataChunk, DimensionChunkAttributes
           rowId = chunkAttributes.getInvertedIndexesReverse()[rowId];
         }
         int start = rowId * chunkAttributes.getColumnValueSize();
    +    int dict = getInt(chunkAttributes.getColumnValueSize(), start);
    +    row[columnIndex] = dict;
    +    return columnIndex + 1;
    +  }
    +
    +  @Override public int fillConvertedChunkData(ColumnVectorInfo[] vectorInfo, int column,
    +      KeyStructureInfo restructuringInfo) {
    +    ColumnVectorInfo columnVectorInfo = vectorInfo[column];
    +    int offset = columnVectorInfo.offset;
    +    int vectorOffset = columnVectorInfo.vectorOffset;
    +    int len = columnVectorInfo.size + offset;
    +    int[] indexesReverse = chunkAttributes.getInvertedIndexesReverse();
    +    int columnValueSize = chunkAttributes.getColumnValueSize();
    +    CarbonColumnVector vector = columnVectorInfo.vector;
    +    for (int j = offset; j < len; j++) {
    +      int start =
    +          indexesReverse == null ? j * columnValueSize : indexesReverse[j] * columnValueSize;
    +      int dict = getInt(columnValueSize, start);
    +      if (columnVectorInfo.directDictionaryGenerator == null) {
    +        vector.putInt(vectorOffset++, dict);
    +      } else {
    +        Object valueFromSurrogate =
    +            columnVectorInfo.directDictionaryGenerator.getValueFromSurrogate(dict);
    +        if (valueFromSurrogate == null) {
    +          vector.putNull(vectorOffset++);
    +        } else {
    +          vector.putLong(vectorOffset++, (long) valueFromSurrogate);
    +        }
    +      }
    +    }
    +    return column + 1;
    +  }
    +
    +  @Override
    +  public int fillConvertedChunkData(int[] rowMapping, ColumnVectorInfo[] vectorInfo,
int column,
    +      KeyStructureInfo restructuringInfo) {
    +    ColumnVectorInfo columnVectorInfo = vectorInfo[column];
    +    int offset = columnVectorInfo.offset;
    +    int vectorOffset = columnVectorInfo.vectorOffset;
    +    int len = columnVectorInfo.size + offset;
    +    int[] indexesReverse = chunkAttributes.getInvertedIndexesReverse();
    +    int columnValueSize = chunkAttributes.getColumnValueSize();
    +    CarbonColumnVector vector = columnVectorInfo.vector;
    +    for (int j = offset; j < len; j++) {
    +      int start = indexesReverse == null ?
    +          rowMapping[j] * columnValueSize :indexesReverse[rowMapping[j]] * columnValueSize;
    --- End diff --
    
    add space after : 
    can we add some notes or docs to show the logic, so readers can understand easily


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