Revert "#949 Refine column family for measures" This reverts commit 906b8f40b381ab9086a4f7e7593ae7d8391189bd.
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/32d346b4 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/32d346b4 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/32d346b4 Branch: refs/heads/2622-2764 Commit: 32d346b4cd619a38461a27115fbef2bd44f28372 Parents: b50030d Author: Hongbin Ma <mahong...@apache.org> Authored: Thu Aug 31 22:41:20 2017 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Thu Aug 31 22:41:20 2017 +0800 ---------------------------------------------------------------------- .../org/apache/kylin/gridtable/GTRecord.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/32d346b4/core-cube/src/main/java/org/apache/kylin/gridtable/GTRecord.java ---------------------------------------------------------------------- diff --git a/core-cube/src/main/java/org/apache/kylin/gridtable/GTRecord.java b/core-cube/src/main/java/org/apache/kylin/gridtable/GTRecord.java index 00e355f..d8c0fbd 100644 --- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTRecord.java +++ b/core-cube/src/main/java/org/apache/kylin/gridtable/GTRecord.java @@ -45,7 +45,7 @@ public class GTRecord implements Comparable<GTRecord>, Cloneable { } this.info = info; } - + @Override public GTRecord clone() { // deep copy ByteArray[] cols = new ByteArray[this.cols.length]; @@ -114,6 +114,7 @@ public class GTRecord implements Comparable<GTRecord>, Cloneable { return result; } + /** decode and return the values of this record */ public Object[] getValues(int[] selectedColumns, Object[] result) { assert selectedColumns.length <= result.length; @@ -294,21 +295,27 @@ public class GTRecord implements Comparable<GTRecord>, Cloneable { buf.position(pos); } } - - public void loadColumnsFromColumnBlocks(ImmutableBitSet[] selectedColumnBlocks, ImmutableBitSet selectedCols, - ByteBuffer buf) { + + public void loadColumnsFromColumnBlocks(ImmutableBitSet[] selectedColumnBlocks, ImmutableBitSet selectedCols, ByteBuffer buf) { + int pos = buf.position(); + for (ImmutableBitSet selectedColBlock : selectedColumnBlocks) { + for (int i = 0; i < selectedColBlock.trueBitCount(); i++) { + int c = selectedColBlock.trueBitAt(i); + int len = info.codeSystem.codeLength(c, buf); - if (selectedCols.get(c)) { - cols[c].set(buf.array(), buf.arrayOffset() + pos, len); + if(selectedCols.get(c)) { + cols[c].set(buf.array(), buf.arrayOffset() + pos, len); } pos += len; buf.position(pos); } + } + } /** change pointers to point to data in given buffer, this