本文整理汇总了Java中org.apache.kylin.metadata.filter.CompareTupleFilter.getValues方法的典型用法代码示例。如果您正苦于以下问题:Java CompareTupleFilter.getValues方法的具体用法?Java CompareTupleFilter.getValues怎么用?Java CompareTupleFilter.getValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.kylin.metadata.filter.CompareTupleFilter
的用法示例。
在下文中一共展示了CompareTupleFilter.getValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateToAndDimRanges
import org.apache.kylin.metadata.filter.CompareTupleFilter; //导入方法依赖的package包/类
private Collection<ColumnValueRange> translateToAndDimRanges(List<? extends TupleFilter> andFilters, CubeSegment cubeSegment) {
Map<TblColRef, ColumnValueRange> rangeMap = new HashMap<TblColRef, ColumnValueRange>();
for (TupleFilter filter : andFilters) {
if ((filter instanceof CompareTupleFilter) == false) {
continue;
}
CompareTupleFilter comp = (CompareTupleFilter) filter;
if (comp.getColumn() == null) {
continue;
}
ColumnValueRange range = new ColumnValueRange(comp.getColumn(), comp.getValues(), comp.getOperator());
andMerge(range, rangeMap);
}
return rangeMap.values();
}
示例2: translateToAndDimRanges
import org.apache.kylin.metadata.filter.CompareTupleFilter; //导入方法依赖的package包/类
private Collection<ColumnRange> translateToAndDimRanges(List<? extends TupleFilter> andFilters) {
Map<TblColRef, ColumnRange> rangeMap = new HashMap<TblColRef, ColumnRange>();
for (TupleFilter filter : andFilters) {
if ((filter instanceof CompareTupleFilter) == false) {
if (filter instanceof ConstantTupleFilter && !filter.evaluate(null, null)) {
return null;
} else {
continue;
}
}
CompareTupleFilter comp = (CompareTupleFilter) filter;
if (comp.getColumn() == null) {
continue;
}
@SuppressWarnings("unchecked")
ColumnRange newRange = new ColumnRange(comp.getColumn(), (Set<ByteArray>) comp.getValues(), comp.getOperator());
ColumnRange existing = rangeMap.get(newRange.column);
if (existing == null) {
rangeMap.put(newRange.column, newRange);
} else {
existing.andMerge(newRange);
}
}
return rangeMap.values();
}
示例3: evalCompareIn
import org.apache.kylin.metadata.filter.CompareTupleFilter; //导入方法依赖的package包/类
private ConciseSet evalCompareIn(CompareTupleFilter filter) {
ConciseSet set = new ConciseSet();
for (String value : filter.getValues()) {
int id = Dictionary.stringToDictId(value);
ConciseSet bitMap = provider.getBitMap(filter.getColumn(), id, id);
if (bitMap == null)
return null;
set.addAll(bitMap);
}
return set;
}
示例4: onSerialize
import org.apache.kylin.metadata.filter.CompareTupleFilter; //导入方法依赖的package包/类
@Override
public TupleFilter onSerialize(TupleFilter filter) {
if (filter == null)
return null;
BuiltInFunctionTransformer translator = new BuiltInFunctionTransformer(dimEncMap);
filter = translator.transform(filter);
// un-evaluatable filter is replaced with TRUE
if (!filter.isEvaluable()) {
TupleFilter.collectColumns(filter, inevaluableColumns);
return ConstantTupleFilter.TRUE;
}
if (!(filter instanceof CompareTupleFilter))
return filter;
// double check all internal of CompareTupleFilter is evaluatable
if (!TupleFilter.isEvaluableRecursively(filter)) {
TupleFilter.collectColumns(filter, inevaluableColumns);
return ConstantTupleFilter.TRUE;
}
if (filterConstantsTreatment == FilterConstantsTreatment.AS_IT_IS) {
return filter;
} else {
// extract ColumnFilter & ConstantFilter
CompareTupleFilter compareFilter = (CompareTupleFilter) filter;
TblColRef col = compareFilter.getColumn();
if (col == null) {
return filter;
}
Collection<String> constValues = (Collection<String>) compareFilter.getValues();
if (constValues == null || constValues.isEmpty()) {
return filter;
}
CompareTupleFilter newCompareFilter = new CompareTupleFilter(compareFilter.getOperator());
newCompareFilter.addChild(new ColumnTupleFilter(col));
if (filterConstantsTreatment == FilterConstantsTreatment.REPLACE_WITH_GLOBAL_DICT) {
return replaceConstantsWithGlobalDict(compareFilter, newCompareFilter);
} else if (filterConstantsTreatment == FilterConstantsTreatment.REPLACE_WITH_LOCAL_DICT) {
return replaceConstantsWithLocalDict(compareFilter, newCompareFilter);
} else {
throw new RuntimeException("should not reach here");
}
}
}