public int getSize() { return getMaxId() - getMinId() + 1; }
public MultipleDictionaryValueEnumerator(DataType dataType, List<DictionaryInfo> dictionaryInfoList) { this.dataType = dataType; dictionaryList = Lists.newArrayListWithCapacity(dictionaryInfoList.size()); for (DictionaryInfo dictInfo : dictionaryInfoList) { Dictionary<String> dictionary = (Dictionary<String>) dictInfo.getDictionaryObject(); dictionaryList.add((Dictionary<String>) dictInfo.getDictionaryObject()); curKeys.add(dictionary.getMinId()); } }
public List<T> enumeratorValues() { List<T> ret = Lists.newArrayListWithExpectedSize(getSize()); for (int i = getMinId(); i <= getMaxId(); i++) { ret.add(getValueFromId(i)); } return ret; }
public ShrunkenDictionary<T> build(ValueSerializer<T> valueSerializer) { return new ShrunkenDictionary<>(valueSerializer, fullDict.getMinId(), fullDict.getMaxId(), fullDict.getSizeOfId(), fullDict.getSizeOfValue(), valueToIdMap); } }
@Override public boolean contains(Dictionary other) { if (other.getSize() > this.getSize()) { return false; } for (int i = other.getMinId(); i <= other.getMaxId(); ++i) { T v = (T) other.getValueFromId(i); if (!this.containsValue(v)) { return false; } } return true; }
@Override public boolean contains(Dictionary other) { if (other.getSize() > this.getSize()) { return false; } for (int i = other.getMinId(); i <= other.getMaxId(); ++i) { T v = (T) other.getValueFromId(i); if (!this.containsValue(v)) { return false; } } return true; }
for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) { Object dictVal = dict.getValueFromId(i); Object computedVal = builtInFunctionTupleFilter.invokeFunction(dictVal);
private TupleFilter translateFunctionTupleFilter(BuiltInFunctionTupleFilter builtInFunctionTupleFilter) { if (!builtInFunctionTupleFilter.isValid()) return null; TblColRef columnRef = builtInFunctionTupleFilter.getColumn(); Dictionary<?> dict = dimEncMap.getDictionary(columnRef); if (dict == null) return null; CompareTupleFilter translated = new CompareTupleFilter(builtInFunctionTupleFilter.isReversed() ? FilterOperatorEnum.NOTIN : FilterOperatorEnum.IN); translated.addChild(new ColumnTupleFilter(columnRef)); try { int translatedInClauseMaxSize = KylinConfig.getInstanceFromEnv().getTranslatedInClauseMaxSize(); for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) { Object dictVal = dict.getValueFromId(i); if ((Boolean) builtInFunctionTupleFilter.invokeFunction(dictVal)) { translated.addChild(new ConstantTupleFilter(dictVal)); if (translated.getChildren().size() > translatedInClauseMaxSize) { return null; } } } logger.debug("getting a in clause with {} children", translated.getChildren().size()); } catch (Exception e) { logger.debug(e.getMessage()); return null; } return translated; }
public MultipleDictionaryValueEnumerator(List<DictionaryInfo> dictionaryInfoList) { dictionaryList = Lists.newArrayListWithCapacity(dictionaryInfoList.size()); for (DictionaryInfo dictInfo : dictionaryInfoList) { dictionaryList.add(dictInfo.getDictionaryObject()); } if (!dictionaryList.isEmpty()) { curDict = dictionaryList.get(0); curKey = curDict.getMinId(); } }
public int getSize() { return getMaxId() - getMinId() + 1; }
public int getSize() { return getMaxId() - getMinId() + 1; }
public MultipleDictionaryValueEnumerator(DataType dataType, List<DictionaryInfo> dictionaryInfoList) { this.dataType = dataType; dictionaryList = Lists.newArrayListWithCapacity(dictionaryInfoList.size()); for (DictionaryInfo dictInfo : dictionaryInfoList) { Dictionary<String> dictionary = (Dictionary<String>) dictInfo.getDictionaryObject(); dictionaryList.add((Dictionary<String>) dictInfo.getDictionaryObject()); curKeys.add(dictionary.getMinId()); } }
public List<T> enumeratorValues() { List<T> ret = Lists.newArrayListWithExpectedSize(getSize()); for (int i = getMinId(); i <= getMaxId(); i++) { ret.add(getValueFromId(i)); } return ret; }
@Override public boolean moveNext() throws IOException { if (curDictIndex < dictionaryList.size() && curKey <= curDict.getMaxId()) { byte[] buffer = new byte[curDict.getSizeOfValue()]; int size = curDict.getValueBytesFromId(curKey, buffer, 0); curValue = Bytes.copy(buffer, 0, size); if (++curKey > curDict.getMaxId()) { if (++curDictIndex < dictionaryList.size()) { curDict = dictionaryList.get(curDictIndex); curKey = curDict.getMinId(); } } return true; } curValue = null; return false; }
public ShrunkenDictionary<T> build(ValueSerializer<T> valueSerializer) { return new ShrunkenDictionary<>(valueSerializer, fullDict.getMinId(), fullDict.getMaxId(), fullDict.getSizeOfId(), fullDict.getSizeOfValue(), valueToIdMap); } }
@Override public boolean contains(Dictionary other) { if (other.getSize() > this.getSize()) { return false; } for (int i = other.getMinId(); i <= other.getMaxId(); ++i) { T v = (T) other.getValueFromId(i); if (!this.containsValue(v)) { return false; } } return true; }
@Override public boolean contains(Dictionary other) { if (other.getSize() > this.getSize()) { return false; } for (int i = other.getMinId(); i <= other.getMaxId(); ++i) { T v = (T) other.getValueFromId(i); if (!this.containsValue(v)) { return false; } } return true; }
private TupleFilter translateFunctionTupleFilter(BuiltInFunctionTupleFilter builtInFunctionTupleFilter) { if (!builtInFunctionTupleFilter.isValid()) return null; TblColRef columnRef = builtInFunctionTupleFilter.getColumn(); Dictionary<?> dict = dimEncMap.getDictionary(columnRef); if (dict == null) return null; CompareTupleFilter translated = new CompareTupleFilter(builtInFunctionTupleFilter.isReversed() ? FilterOperatorEnum.NOTIN : FilterOperatorEnum.IN); translated.addChild(new ColumnTupleFilter(columnRef)); try { int translatedInClauseMaxSize = KylinConfig.getInstanceFromEnv().getTranslatedInClauseMaxSize(); for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) { Object dictVal = dict.getValueFromId(i); if ((Boolean) builtInFunctionTupleFilter.invokeFunction(dictVal)) { translated.addChild(new ConstantTupleFilter(dictVal)); if (translated.getChildren().size() > translatedInClauseMaxSize) { return null; } } } logger.debug("getting a in clause with {} children", translated.getChildren().size()); } catch (Exception e) { logger.debug(e.getMessage()); return null; } return translated; }
for (int i = dict.getMinId(); i <= dict.getMaxId(); i++) { Object dictVal = dict.getValueFromId(i); Object computedVal = builtInFunctionTupleFilter.invokeFunction(dictVal);