Search in sources :

Example 16 with MapKey

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;
}
Also used : MapKey(io.questdb.cairo.map.MapKey)

Example 17 with MapKey

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;
        }
    }
}
Also used : MapKey(io.questdb.cairo.map.MapKey)

Example 18 with MapKey

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);
    }
}
Also used : MapKey(io.questdb.cairo.map.MapKey) MapValue(io.questdb.cairo.map.MapValue)

Example 19 with MapKey

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;
}
Also used : MapKey(io.questdb.cairo.map.MapKey) MapValue(io.questdb.cairo.map.MapValue)

Example 20 with MapKey

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;
}
Also used : MapKey(io.questdb.cairo.map.MapKey) MapValue(io.questdb.cairo.map.MapValue)

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