本文整理汇总了Java中org.apache.kylin.metadata.filter.TupleFilterSerializer类的典型用法代码示例。如果您正苦于以下问题:Java TupleFilterSerializer类的具体用法?Java TupleFilterSerializer怎么用?Java TupleFilterSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TupleFilterSerializer类属于org.apache.kylin.metadata.filter包,在下文中一共展示了TupleFilterSerializer类的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);
}
示例2: testSerialize08
import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入依赖的package包/类
@Test
public void testSerialize08() {
TableDesc table = new TableDesc();
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);
}
示例3: StreamSQLDigest
import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入依赖的package包/类
public StreamSQLDigest(SQLDigest sqlDigest, TblColRef tsCol) {
this.sqlDigest = sqlDigest;
//must use new instance of IgnoreTsCondition
TsConditionEraser decorator = new TsConditionEraser(tsCol, sqlDigest.filter);
filterSerialized = TupleFilterSerializer.serialize(sqlDigest.filter, decorator, StringCodeSystem.INSTANCE);
int nonFilterHashCode = calculateNonFilterHashCode();
this.hashCode = 31 * nonFilterHashCode + Arrays.hashCode(filterSerialized);
}
示例4: 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());
}
示例5: 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]);
}
示例6: 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]);
}
示例7: 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]);
}
示例8: 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]);
}
示例9: 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]);
}
示例10: 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]);
}
示例11: 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]);
}
示例12: 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);
}
示例13: 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]);
}
示例14: 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);
}
示例15: serialize
import org.apache.kylin.metadata.filter.TupleFilterSerializer; //导入依赖的package包/类
@Override
public void serialize(GTScanRequest value, ByteBuffer out) {
final int serialLevel = KylinConfig.getInstanceFromEnv().getGTScanRequestSerializationLevel();
GTInfo.serializer.serialize(value.info, out);
BytesUtil.writeVInt(value.ranges.size(), out);
for (GTScanRange range : value.ranges) {
serializeGTRecord(range.pkStart, out);
serializeGTRecord(range.pkEnd, out);
BytesUtil.writeVInt(range.fuzzyKeys.size(), out);
for (GTRecord f : range.fuzzyKeys) {
serializeGTRecord(f, out);
}
}
ImmutableBitSet.serializer.serialize(value.columns, out);
BytesUtil.writeByteArray(GTUtil.serializeGTFilter(value.filterPushDown, value.info), out);
if (serialLevel >= SERIAL_1_HAVING_FILTER) {
BytesUtil.writeByteArray(
TupleFilterSerializer.serialize(value.havingFilterPushDown, StringCodeSystem.INSTANCE), out);
}
ImmutableBitSet.serializer.serialize(value.aggrGroupBy, out);
ImmutableBitSet.serializer.serialize(value.aggrMetrics, out);
BytesUtil.writeAsciiStringArray(value.aggrMetricsFuncs, out);
BytesUtil.writeVInt(value.allowStorageAggregation ? 1 : 0, out);
out.putDouble(value.aggCacheMemThreshold);
BytesUtil.writeUTFString(value.getStorageLimitLevel().name(), out);
BytesUtil.writeVInt(value.storageScanRowNumThreshold, out);
BytesUtil.writeVInt(value.storagePushDownLimit, out);
BytesUtil.writeVLong(value.startTime, out);
BytesUtil.writeVLong(value.timeout, out);
BytesUtil.writeUTFString(value.storageBehavior, out);
}