Search in sources :

Example 1 with MapRecord

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

the class AbstractSampleByFillValueRecordCursor method toTop.

@Override
public void toTop() {
    super.toTop();
    if (base.hasNext()) {
        baseRecord = base.getRecord();
        int n = groupByFunctions.size();
        RecordCursor mapCursor = map.getCursor();
        MapRecord mapRecord = map.getRecord();
        while (mapCursor.hasNext()) {
            MapValue value = mapRecord.getValue();
            // timestamp is always stored in value field 0
            value.putLong(0, Numbers.LONG_NaN);
            // this would set values for when keys are not found right away
            for (int i = 0; i < n; i++) {
                groupByFunctions.getQuick(i).setNull(value);
            }
        }
    }
}
Also used : MapRecord(io.questdb.cairo.map.MapRecord) RecordCursor(io.questdb.cairo.sql.RecordCursor) MapValue(io.questdb.cairo.map.MapValue)

Example 2 with MapRecord

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

the class SampleByFillPrevRecordCursor method toTop.

@Override
public void toTop() {
    super.toTop();
    if (base.hasNext()) {
        baseRecord = base.getRecord();
        int n = groupByFunctions.size();
        RecordCursor mapCursor = map.getCursor();
        MapRecord mapRecord = map.getRecord();
        while (mapCursor.hasNext()) {
            MapValue value = mapRecord.getValue();
            // timestamp is always stored in value field 0
            value.putLong(0, Numbers.LONG_NaN);
            // this would set values for when keys are not found right away
            for (int i = 0; i < n; i++) {
                groupByFunctions.getQuick(i).setNull(value);
            }
        }
    }
}
Also used : MapRecord(io.questdb.cairo.map.MapRecord) RecordCursor(io.questdb.cairo.sql.RecordCursor) MapValue(io.questdb.cairo.map.MapValue)

Aggregations

MapRecord (io.questdb.cairo.map.MapRecord)2 MapValue (io.questdb.cairo.map.MapValue)2 RecordCursor (io.questdb.cairo.sql.RecordCursor)2