Search in sources :

Example 1 with HeapSortRunGenerator

use of org.apache.hyracks.dataflow.std.sort.HeapSortRunGenerator in project asterixdb by apache.

the class TopKRunGeneratorTest method testAlreadySortedDataShouldNotGenerateAnyRuns.

@Test
public void testAlreadySortedDataShouldNotGenerateAnyRuns() throws HyracksDataException {
    int topK = SORT_FRAME_LIMIT;
    IHyracksTaskContext ctx = AbstractRunGeneratorTest.testUtils.create(PAGE_SIZE);
    HeapSortRunGenerator sorter = new HeapSortRunGenerator(ctx, SORT_FRAME_LIMIT, topK, SortFields, null, ComparatorFactories, RecordDesc);
    testInMemoryOnly(ctx, topK, ORDER.INORDER, sorter);
}
Also used : IHyracksTaskContext(org.apache.hyracks.api.context.IHyracksTaskContext) HeapSortRunGenerator(org.apache.hyracks.dataflow.std.sort.HeapSortRunGenerator) Test(org.junit.Test)

Example 2 with HeapSortRunGenerator

use of org.apache.hyracks.dataflow.std.sort.HeapSortRunGenerator in project asterixdb by apache.

the class TopKRunGeneratorTest method testReverseOrderedDataShouldNotGenerateAnyRuns.

@Test
public void testReverseOrderedDataShouldNotGenerateAnyRuns() throws HyracksDataException {
    int topK = 1;
    IHyracksTaskContext ctx = AbstractRunGeneratorTest.testUtils.create(PAGE_SIZE);
    HeapSortRunGenerator sorter = new HeapSortRunGenerator(ctx, SORT_FRAME_LIMIT, topK, SortFields, null, ComparatorFactories, RecordDesc);
    testInMemoryOnly(ctx, topK, ORDER.REVERSE, sorter);
}
Also used : IHyracksTaskContext(org.apache.hyracks.api.context.IHyracksTaskContext) HeapSortRunGenerator(org.apache.hyracks.dataflow.std.sort.HeapSortRunGenerator) Test(org.junit.Test)

Aggregations

IHyracksTaskContext (org.apache.hyracks.api.context.IHyracksTaskContext)2 HeapSortRunGenerator (org.apache.hyracks.dataflow.std.sort.HeapSortRunGenerator)2 Test (org.junit.Test)2