当前位置: 首页>>代码示例>>Java>>正文


Java CompareTupleFilter.getValues方法代码示例

本文整理汇总了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();
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:19,代码来源:CubeStorageEngine.java

示例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();
}
 
开发者ID:apache,项目名称:kylin,代码行数:28,代码来源:ScanRangePlannerBase.java

示例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;
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:12,代码来源:BitMapFilterEvaluator.java

示例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");
        }
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:53,代码来源:FilterDecorator.java


注:本文中的org.apache.kylin.metadata.filter.CompareTupleFilter.getValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。