use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class IntersectRecordCursor method hasNext.
@Override
public boolean hasNext() {
while (masterCursor.hasNext()) {
MapKey key = map.withKey();
key.put(masterRecord, recordSink);
if (key.findValue() != null) {
return true;
}
interruptor.checkInterrupted();
}
return false;
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class UnionRecordCursor method nextSlave.
private boolean nextSlave() {
while (true) {
boolean next = slaveCursor.hasNext();
if (next) {
MapKey key = map.withKey();
key.put(record, recordSink);
if (key.create()) {
return true;
}
interruptor.checkInterrupted();
} else {
return false;
}
}
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class JoinRecordMetadata method addToMap.
private void addToMap(CharSequence columnName, int dot, TableColumnMetadata cm) {
MapKey key;
MapValue value;
this.columnMetadata.add(cm);
key = map.withKey();
key.putStr(null);
key.putStrLowerCase(columnName, dot + 1, columnName.length());
value = key.createValue();
if (value.isNew()) {
value.putInt(0, columnCount - 1);
} else {
// this is a duplicate columns, if somebody looks it up without alias
// we would treat this lookup as if column hadn't been found.
value.putInt(0, -1);
}
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class JoinRecordMetadata method addAlias.
private int addAlias(CharSequence tableAlias, CharSequence columnName) {
int dot = Chars.indexOf(columnName, '.');
assert dot != -1 || tableAlias != null;
// add column with its own alias
MapKey key = map.withKey();
if (dot == -1) {
key.putStrLowerCase(tableAlias);
} else {
assert tableAlias == null;
key.putStrLowerCase(columnName, 0, dot);
}
key.putStrLowerCase(columnName, dot + 1, columnName.length());
MapValue value = key.createValue();
if (!value.isNew()) {
throw CairoException.instance(0).put("Duplicate column [name=").put(columnName).put(", tableAlias=").put(tableAlias).put(']');
}
value.putLong(0, columnCount++);
return dot;
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class JoinRecordMetadata method getColumnIndexQuiet.
@Override
public int getColumnIndexQuiet(CharSequence columnName, int lo, int hi) {
final MapKey key = map.withKey();
final int dot = Chars.indexOf(columnName, lo, '.');
if (dot == -1) {
key.putStrLowerCase(null);
key.putStrLowerCase(columnName, lo, hi);
} else {
key.putStrLowerCase(columnName, 0, dot);
key.putStrLowerCase(columnName, dot + 1, columnName.length());
}
MapValue value = key.findValue();
if (value != null) {
return value.getInt(0);
}
return -1;
}
Aggregations