Search in sources :

Example 31 with MapKey

use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.

the class LatestByAllFilteredRecordCursor method buildTreeMap.

@Override
protected void buildTreeMap(SqlExecutionContext executionContext) throws SqlException {
    map.clear();
    filter.init(this, executionContext);
    DataFrame frame;
    while ((frame = this.dataFrameCursor.next()) != null) {
        final int partitionIndex = frame.getPartitionIndex();
        final long rowLo = frame.getRowLo();
        final long rowHi = frame.getRowHi() - 1;
        recordA.jumpTo(frame.getPartitionIndex(), rowHi);
        for (long row = rowHi; row >= rowLo; row--) {
            recordA.setRecordIndex(row);
            if (filter.getBool(recordA)) {
                MapKey key = map.withKey();
                key.put(recordA, recordSink);
                if (key.create()) {
                    rows.add(Rows.toRowID(partitionIndex, row));
                }
            }
        }
    }
    map.clear();
}
Also used : MapKey(io.questdb.cairo.map.MapKey) DataFrame(io.questdb.cairo.sql.DataFrame)

Example 32 with MapKey

use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.

the class UnionRecordCursor method nextMaster.

private boolean nextMaster() {
    if (masterCursor.hasNext()) {
        MapKey key = map.withKey();
        key.put(record, recordSink);
        key.create();
        return true;
    }
    return switchToSlaveCursor();
}
Also used : MapKey(io.questdb.cairo.map.MapKey)

Example 33 with MapKey

use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.

the class ExceptRecordCursor method hasNext.

@Override
public boolean hasNext() {
    while (masterCursor.hasNext()) {
        MapKey key = map.withKey();
        key.put(masterRecord, recordSink);
        if (key.notFound()) {
            return true;
        }
        interruptor.checkInterrupted();
    }
    return false;
}
Also used : MapKey(io.questdb.cairo.map.MapKey)

Example 34 with MapKey

use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.

the class ExceptRecordCursor method populateSlaveMap.

private void populateSlaveMap(RecordCursor cursor) {
    final Record record = cursor.getRecord();
    while (cursor.hasNext()) {
        MapKey key = map.withKey();
        key.put(record, recordSink);
        key.createValue();
        interruptor.checkInterrupted();
    }
}
Also used : MapKey(io.questdb.cairo.map.MapKey) Record(io.questdb.cairo.sql.Record)

Aggregations

MapKey (io.questdb.cairo.map.MapKey)34 MapValue (io.questdb.cairo.map.MapValue)17 DataFrame (io.questdb.cairo.sql.DataFrame)2 Record (io.questdb.cairo.sql.Record)2 SqlExecutionInterruptor (io.questdb.griffin.SqlExecutionInterruptor)2 EmptyTableRandomRecordCursor (io.questdb.griffin.engine.EmptyTableRandomRecordCursor)2 EmptyTableNoSizeRecordCursor (io.questdb.griffin.engine.EmptyTableNoSizeRecordCursor)1