public TupleBuffer sort() throws TeiidComponentException, TeiidProcessingException { return sort(-1); }
public TupleBuffer sort() throws TeiidComponentException, TeiidProcessingException { return sort(-1); }
public TupleBuffer sort() throws TeiidComponentException, TeiidProcessingException { return sort(-1); }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { this.sortBuffer = this.sortUtility.sort(); this.sortBuffer.setForwardOnly(true); this.groupTupleSource = this.sortBuffer.createIndexedTupleSource(); this.phase = GROUP; }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { this.sortBuffer = this.sortUtility.sort(); this.sortBuffer.setForwardOnly(true); this.groupTupleSource = this.sortBuffer.createIndexedTupleSource(); this.phase = GROUP; }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { this.sortBuffer = this.sortUtility.sort(); this.sortBuffer.setForwardOnly(true); this.groupTupleSource = this.sortBuffer.createIndexedTupleSource(); this.phase = GROUP; }
dvs = new DependentValueSource(sortUtility.sort());
dvs = new DependentValueSource(sortUtility.sort());
SortUtility sort = new SortUtility(ts, orderBy.getOrderByItems(), Mode.SORT, bm, sessionID, projectedCols); sort.setNonBlocking(true); tb = sort.sort(); } else if (agg) { int count = 0;
SortUtility sort = new SortUtility(ts, orderBy.getOrderByItems(), Mode.SORT, bm, sessionID, projectedCols); sort.setNonBlocking(true); tb = sort.sort(); } else if (agg) { int count = 0;
SortUtility sort = new SortUtility(ts, orderBy.getOrderByItems(), Mode.SORT, bm, sessionID, projectedCols); sort.setNonBlocking(true); tb = sort.sort(); } else if (agg) { int count = 0;
@Test public void testDistinct() throws Exception { ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$ es1.setType(DataTypeManager.DefaultDataClasses.INTEGER); ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$ es2.setType(DataTypeManager.DefaultDataClasses.INTEGER); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); TupleBuffer tsid = bm.createTupleBuffer(Arrays.asList(es1, es2), "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$ tsid.addTuple(Arrays.asList(1, 1)); tsid.addTuple(Arrays.asList(1, 2)); tsid.close(); SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.DUP_REMOVE_SORT, bm, "test", tsid.getSchema()); //$NON-NLS-1$ su.sort(); assertFalse(su.isDistinct()); }
@Test public void testStableSort() throws Exception { ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$ es1.setType(DataTypeManager.DefaultDataClasses.INTEGER); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); TupleBuffer tsid = bm.createTupleBuffer(Arrays.asList(es1, es1), "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$ tsid.addTuple(Arrays.asList(1, 1)); tsid.addTuple(Arrays.asList(1, 2)); tsid.addTuple(Arrays.asList(1, 3)); tsid.close(); SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.SORT, bm, "test", tsid.getSchema()); //$NON-NLS-1$ su.setBatchSize(1); su.setStableSort(true); TupleBuffer out = su.sort(); TupleSource ts = out.createIndexedTupleSource(); assertEquals(Arrays.asList(1,1), ts.nextTuple()); assertEquals(Arrays.asList(1,2), ts.nextTuple()); assertEquals(Arrays.asList(1,3), ts.nextTuple()); assertNull(ts.nextTuple()); }
@Test public void testSortLimit() throws Exception { ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$ es1.setType(DataTypeManager.DefaultDataClasses.INTEGER); BufferManager bm = BufferManagerFactory.getStandaloneBufferManager(); TupleBuffer tsid = bm.createTupleBuffer(Arrays.asList(es1, es1), "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$ tsid.addTuple(Arrays.asList(4)); tsid.addTuple(Arrays.asList(3)); tsid.addTuple(Arrays.asList(2)); tsid.addTuple(Arrays.asList(1)); tsid.close(); SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.SORT, bm, "test", tsid.getSchema()); //$NON-NLS-1$ su.setBatchSize(2); TupleBuffer out = su.sort(2); TupleSource ts = out.createIndexedTupleSource(); assertEquals(Arrays.asList(1), ts.nextTuple()); assertEquals(Arrays.asList(2), ts.nextTuple()); assertNull(ts.nextTuple()); su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.SORT, bm, "test", tsid.getSchema()); //$NON-NLS-1$ su.setBatchSize(10); out = su.sort(2); ts = out.createIndexedTupleSource(); assertEquals(Arrays.asList(1), ts.nextTuple()); assertEquals(Arrays.asList(2), ts.nextTuple()); assertNull(ts.nextTuple()); }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { if (this.sortUtility == null) { TupleSource ts = null; TupleBuffer working = null; if (!getChildren()[0].hasBuffer()) { ts = new BatchIterator(getChildren()[0]); } else { working = getChildren()[0].getBuffer(-1); } this.sortUtility = new SortUtility(ts, items, this.mode, getBufferManager(), getConnectionID(), getChildren()[0].getElements()); if (ts == null) { this.sortUtility.setWorkingBuffer(working); } } this.output = this.sortUtility.sort(rowLimit); if (this.outputTs == null) { this.outputTs = this.output.createIndexedTupleSource(); } this.phase = OUTPUT; }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { if (this.sortUtility == null) { TupleSource ts = null; TupleBuffer working = null; if (!getChildren()[0].hasBuffer()) { ts = new BatchIterator(getChildren()[0]); } else { working = getChildren()[0].getBuffer(-1); } this.sortUtility = new SortUtility(ts, items, this.mode, getBufferManager(), getConnectionID(), getChildren()[0].getElements()); if (ts == null) { this.sortUtility.setWorkingBuffer(working); } } this.output = this.sortUtility.sort(rowLimit); if (this.outputTs == null) { this.outputTs = this.output.createIndexedTupleSource(); } this.phase = OUTPUT; }
private void sortPhase() throws BlockedException, TeiidComponentException, TeiidProcessingException { if (this.sortUtility == null) { TupleSource ts = null; TupleBuffer working = null; if (!getChildren()[0].hasBuffer()) { ts = new BatchIterator(getChildren()[0]); } else { working = getChildren()[0].getBuffer(-1); } this.sortUtility = new SortUtility(ts, items, this.mode, getBufferManager(), getConnectionID(), getChildren()[0].getElements()); if (ts == null) { this.sortUtility.setWorkingBuffer(working); } } this.output = this.sortUtility.sort(rowLimit); if (this.outputTs == null) { this.outputTs = this.output.createIndexedTupleSource(); } this.phase = OUTPUT; }
this.sortUtility.setWorkingBuffer(collectionBuffer); TupleBuffer sorted = sortUtility.sort(); sorted.setForwardOnly(true); try {
this.sortUtility.setWorkingBuffer(collectionBuffer); TupleBuffer sorted = sortUtility.sort(); sorted.setForwardOnly(true); try {
this.sortUtility.setWorkingBuffer(collectionBuffer); TupleBuffer sorted = sortUtility.sort(); sorted.setForwardOnly(true); try {