diff --git a/omnioperator/omniop-openlookeng-extension/src/main/java/nova/hetu/olk/block/DictionaryOmniBlock.java b/omnioperator/omniop-openlookeng-extension/src/main/java/nova/hetu/olk/block/DictionaryOmniBlock.java index 29e52d440160670795e12d3c5e350cb2b7182f98..e5f0bb63741e6f02c47976cb6037c74e2fa15ee8 100644 --- a/omnioperator/omniop-openlookeng-extension/src/main/java/nova/hetu/olk/block/DictionaryOmniBlock.java +++ b/omnioperator/omniop-openlookeng-extension/src/main/java/nova/hetu/olk/block/DictionaryOmniBlock.java @@ -173,45 +173,6 @@ public class DictionaryOmniBlock } } - /** - * Instantiates a new Dictionary omni block. - * - * @param idsOffset the ids offset - * @param positionCount the position count - * @param dictionaryVec the dictionary vector - * @param dictionary the dictionary - * @param ids the ids - * @param dictionaryIsCompacted the dictionary is compacted - * @param dictionarySourceId the dictionary source id - */ - public DictionaryOmniBlock(int idsOffset, int positionCount, DictionaryVec dictionaryVec, int[] ids, - Block dictionary, boolean dictionaryIsCompacted, DictionaryId dictionarySourceId) - { - requireNonNull(dictionaryVec, "dictionaryVec is null"); - requireNonNull(ids, "ids is null"); - - if (positionCount < 0) { - throw new IllegalArgumentException("positionCount is negative"); - } - - this.idsOffset = idsOffset; - if (ids.length - idsOffset < positionCount) { - throw new IllegalArgumentException("ids length is less than positionCount"); - } - - this.positionCount = positionCount; - this.dictionaryVec = dictionaryVec.slice(0, dictionaryVec.getSize()); - this.dictionary = dictionary.getRegion(0, dictionary.getPositionCount()); - this.ids = ids; - this.dictionarySourceId = requireNonNull(dictionarySourceId, "dictionarySourceId is null"); - this.retainedSizeInBytes = INSTANCE_SIZE + this.dictionary.getRetainedSizeInBytes() + sizeOf(ids); - - if (dictionaryIsCompacted) { - this.sizeInBytes = this.retainedSizeInBytes; - this.uniqueIds = this.dictionary.getPositionCount(); - } - } - /** * Instantiates a new Dictionary omni block. * @@ -527,7 +488,7 @@ public class DictionaryOmniBlock public Block getRegion(int positionOffset, int length) { checkValidRegion(positionCount, positionOffset, length); - return new DictionaryOmniBlock(idsOffset + positionOffset, length, dictionaryVec, ids, dictionary, false, + return new DictionaryOmniBlock(idsOffset + positionOffset, length, dictionaryVec, ids, false, dictionarySourceId); } diff --git a/omnioperator/omniop-openlookeng-extension/src/test/java/nova/hetu/olk/mock/MockUtil.java b/omnioperator/omniop-openlookeng-extension/src/test/java/nova/hetu/olk/mock/MockUtil.java index 0092bd10ce50eea1852673ae8d95ab5238f131e6..a88b21213b698e895ee037a16057c3f0d33ff5e0 100644 --- a/omnioperator/omniop-openlookeng-extension/src/test/java/nova/hetu/olk/mock/MockUtil.java +++ b/omnioperator/omniop-openlookeng-extension/src/test/java/nova/hetu/olk/mock/MockUtil.java @@ -163,7 +163,7 @@ public class MockUtil when(dictionaryVec.getDictionary()).thenReturn(vec); when(dictionaryVec.slice(anyInt(), anyInt())).thenReturn(dictionaryVec); when(dictionaryVec.getAllocator()).thenReturn(vecAllocator); - blocks.put(j, new DictionaryOmniBlock(0, blockModel.values.length, dictionaryVec, idIndex, block, false, randomDictionaryId())); + blocks.put(j, new DictionaryOmniBlock(0, blockModel.values.length, dictionaryVec, idIndex, false, randomDictionaryId())); } else { blocks.put(j, block); @@ -242,7 +242,7 @@ public class MockUtil when(dictionaryVec.getDictionary()).thenReturn(vec); when(dictionaryVec.slice(anyInt(), anyInt())).thenReturn(dictionaryVec); when(dictionaryVec.getAllocator()).thenReturn(vecAllocator); - block = new DictionaryOmniBlock>(0, object.length, dictionaryVec, idIndex, block, false, randomDictionaryId()); + block = new DictionaryOmniBlock>(0, object.length, dictionaryVec, idIndex, false, randomDictionaryId()); } if (lazy) { LazyBlock lazyBlock = new LazyBlock>(block.getPositionCount(), instance -> {});