[
https://issues.apache.org/jira/browse/CARBONDATA-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392206#comment-15392206
]
ASF GitHub Bot commented on CARBONDATA-92:
------------------------------------------
Github user gvramana commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/50#discussion_r72095400
--- Diff:
core/src/main/java/org/carbondata/core/carbon/datastore/chunk/impl/ColumnGroupDimensionDataChunk.java
---
@@ -67,10 +67,29 @@ public ColumnGroupDimensionDataChunk(byte[] dataChunk,
DimensionChunkAttributes
}
/**
- * Below method to get the data based in row id
+ * Converts to column dictionary integer value
+ * @param rowId
+ * @param columnIndex
+ * @param row
+ * @param info @return
+ */
+ @Override public int fillConvertedChunkData(int rowId, int columnIndex,
int[] row,
+ KeyStructureInfo info) {
+ int start = rowId * chunkAttributes.getColumnValueSize();
+ int sizeInBytes = info.getKeyGenerator().getKeySizeInBytes();
+ byte[] key = new byte[sizeInBytes];
+ System.arraycopy(dataChunk, start, key, 0, sizeInBytes);
+ long[] keyArray = info.getKeyGenerator().getKeyArray(key);
--- End diff --
we can avoid this copy also by changing getKeyArray interface to take start
and end position, or wrapping it with ByteBuffer
> Remove the unnecessary intermediate conversion of key while scanning.
> ---------------------------------------------------------------------
>
> Key: CARBONDATA-92
> URL: https://issues.apache.org/jira/browse/CARBONDATA-92
> Project: CarbonData
> Issue Type: Improvement
> Reporter: Ravindra Pesala
>
> Remove the unnecessary intermediate conversion of key while scanning.
> Basically it removes one step in result conversion.
> It avoids System.arraycopy while converting to result.
> It avoids the result preparation step.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)