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


Java TupleFilterSerializer.deserialize方法代码示例

本文整理汇总了Java中org.apache.kylin.metadata.filter.TupleFilterSerializer.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Java TupleFilterSerializer.deserialize方法的具体用法?Java TupleFilterSerializer.deserialize怎么用?Java TupleFilterSerializer.deserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.kylin.metadata.filter.TupleFilterSerializer的用法示例。


在下文中一共展示了TupleFilterSerializer.deserialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSerialize07

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testSerialize07() {
    TableDesc table = new TableDesc();
    table.setName("TEST_KYLIN_FACT");
    table.setDatabase("DEFAULT");

    ColumnDesc column = new ColumnDesc();
    column.setTable(table);
    TblColRef colRef = new TblColRef(column);
    List<TblColRef> groups = new ArrayList<TblColRef>();
    groups.add(colRef);
    TupleFilter filter = buildCompareFilter(groups, 0);

    byte[] bytes = TupleFilterSerializer.serialize(filter);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes);

    compareFilter(filter, newFilter);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:19,代码来源:FilterSerializeTest.java

示例2: fromFilter

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
public static CoprocessorFilter fromFilter(final IDimensionEncodingMap dimEncMap, TupleFilter rootFilter, FilterDecorator.FilterConstantsTreatment filterConstantsTreatment) {
    // translate constants into dictionary IDs via a serialize copy
    FilterDecorator filterDecorator = new FilterDecorator(dimEncMap, filterConstantsTreatment);
    byte[] bytes = TupleFilterSerializer.serialize(rootFilter, filterDecorator, DictCodeSystem.INSTANCE);
    TupleFilter copy = TupleFilterSerializer.deserialize(bytes, DictCodeSystem.INSTANCE);

    return new CoprocessorFilter(copy, filterDecorator.getInevaluableColumns());
}
 
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:CoprocessorFilter.java

示例3: testEvaluate00

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate00() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildEQCompareFilter(groups, 0);

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[0]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例4: testEvaluate01

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate01() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildEQCompareFilter(groups, 1);

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[1]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例5: testEvaluate02

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate02() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildOrFilter(groups);

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[0] + matcheCounts[1] - matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例6: testEvaluate03

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate03() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildAndFilter(groups);

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例7: testEvaluate04

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate04() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareCaseFilter(groups, "0");

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例8: testEvaluate05

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate05() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareCaseFilter(groups, "1");

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[0] - matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例9: testEvaluate06

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate06() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareCaseFilter(groups, "2");

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 1;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, matcheCounts[1] - matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例10: testEvaluate07

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate07() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareCaseFilter(groups, "3");

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, 0);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例11: testEvaluate08

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testEvaluate08() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareCaseFilter(groups, "4");

    byte[] bytes = TupleFilterSerializer.serialize(filter, CS);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes, CS);

    int number = 10000;
    int[] matcheCounts = new int[] { 0, 0, 0 };
    Collection<Tuple> tuples = generateTuple(number, groups, matcheCounts);
    int match = evaluateTuples(tuples, newFilter);

    assertEquals(match, number - matcheCounts[0] - matcheCounts[1] + matcheCounts[2]);
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:FilterEvaluateTest.java

示例12: convertFilter

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
private static TupleFilter convertFilter(TupleFilter rootFilter, final GTInfo info, //
        final Map<TblColRef, Integer> colMapping, final boolean encodeConstants, //
        final Set<TblColRef> unevaluatableColumnCollector) {

    IFilterCodeSystem<ByteArray> filterCodeSystem = wrap(info.codeSystem.getComparator());

    GTConvertDecorator decorator = new GTConvertDecorator(unevaluatableColumnCollector, colMapping, info,
            encodeConstants);

    byte[] bytes = TupleFilterSerializer.serialize(rootFilter, decorator, filterCodeSystem);
    return TupleFilterSerializer.deserialize(bytes, filterCodeSystem);
}
 
开发者ID:apache,项目名称:kylin,代码行数:13,代码来源:GTUtil.java

示例13: testSerialize01

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testSerialize01() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareFilter(groups, 0);

    byte[] bytes = TupleFilterSerializer.serialize(filter);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes);

    compareFilter(filter, newFilter);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:FilterSerializeTest.java

示例14: testSerialize02

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testSerialize02() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildCompareFilter(groups, 1);

    byte[] bytes = TupleFilterSerializer.serialize(filter);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes);

    compareFilter(filter, newFilter);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:FilterSerializeTest.java

示例15: testSerialize03

import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入方法依赖的package包/类
@Test
public void testSerialize03() {
    List<TblColRef> groups = buildGroups();
    TupleFilter filter = buildAndFilter(groups);

    byte[] bytes = TupleFilterSerializer.serialize(filter);
    TupleFilter newFilter = TupleFilterSerializer.deserialize(bytes);

    compareFilter(filter, newFilter);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:FilterSerializeTest.java


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