use of io.questdb.cairo.map.MapValue 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);
}
}
}
}
use of io.questdb.cairo.map.MapValue in project questdb by bluestreak01.
the class SampleByInterpolateRecordCursorFactory method interpolateBoundaryRange.
private void interpolateBoundaryRange(long x1, long x2, Record record) {
// interpolating boundary
for (int i = 0; i < groupByTwoPointFunctionCount; i++) {
GroupByFunction function = groupByTwoPointFunctions.getQuick(i);
MapValue startValue = findDataMapValue2(record, x1);
MapValue endValue = findDataMapValue3(record, x2);
InterpolationUtil.interpolateBoundary(function, sampler.nextTimestamp(x1), startValue, endValue, true);
InterpolationUtil.interpolateBoundary(function, x2, startValue, endValue, false);
}
}
use of io.questdb.cairo.map.MapValue in project questdb by bluestreak01.
the class HashOuterJoinRecordCursorFactory method buildMap.
static void buildMap(RecordCursor slaveCursor, Record record, Map joinKeyMap, RecordSink slaveKeySink, RecordChain slaveChain, SqlExecutionInterruptor interruptor) {
joinKeyMap.clear();
slaveChain.clear();
while (slaveCursor.hasNext()) {
interruptor.checkInterrupted();
MapKey key = joinKeyMap.withKey();
key.put(record, slaveKeySink);
MapValue value = key.createValue();
if (value.isNew()) {
long offset = slaveChain.put(record, -1);
value.putLong(0, offset);
value.putLong(1, offset);
} else {
value.putLong(1, slaveChain.put(record, value.getLong(1)));
}
}
}
Aggregations