Search in sources :

Example 31 with Function

use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.

the class BindVariableServiceImpl method setBin.

@Override
public void setBin(int index, BinarySequence value) throws SqlException {
    indexedVariables.extendPos(index + 1);
    Function function = indexedVariables.getQuick(index);
    if (function == null) {
        indexedVariables.setQuick(index, new BinBindVariable(value));
    } else if (function instanceof BinBindVariable) {
        ((BinBindVariable) function).value = value;
    } else {
        throw SqlException.$(0, "bind variable at ").put(index).put(" is already defined as ").put(ColumnType.nameOf(function.getType()));
    }
}
Also used : Function(io.questdb.cairo.sql.Function)

Example 32 with Function

use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.

the class BindVariableServiceImpl method setDouble.

@Override
public void setDouble(int index, double value) throws SqlException {
    indexedVariables.extendPos(index + 1);
    // variable exists
    Function function = indexedVariables.getQuick(index);
    if (function != null) {
        setDouble0(function, value, index, null);
    } else {
        indexedVariables.setQuick(index, function = doubleVarPool.next());
        ((DoubleBindVariable) function).value = value;
    }
}
Also used : Function(io.questdb.cairo.sql.Function)

Example 33 with Function

use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.

the class BindVariableServiceImpl method setShort.

@Override
public void setShort(int index, short value) throws SqlException {
    indexedVariables.extendPos(index + 1);
    // variable exists
    Function function = indexedVariables.getQuick(index);
    if (function != null) {
        setShort0(function, value, index, null);
    } else {
        indexedVariables.setQuick(index, function = shortVarPool.next());
        ((ShortBindVariable) function).value = value;
    }
}
Also used : Function(io.questdb.cairo.sql.Function)

Example 34 with Function

use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.

the class BindVariableServiceImpl method setTimestamp.

@Override
public void setTimestamp(int index, long value) throws SqlException {
    indexedVariables.extendPos(index + 1);
    // variable exists
    Function function = indexedVariables.getQuick(index);
    if (function != null) {
        setTimestamp0(function, value, index);
    } else {
        indexedVariables.setQuick(index, function = timestampVarPool.next());
        ((TimestampBindVariable) function).value = value;
    }
}
Also used : Function(io.questdb.cairo.sql.Function)

Example 35 with Function

use of io.questdb.cairo.sql.Function in project questdb by bluestreak01.

the class BindVariableServiceImpl method setBoolean.

@Override
public void setBoolean(int index, boolean value) throws SqlException {
    indexedVariables.extendPos(index + 1);
    // variable exists
    Function function = indexedVariables.getQuick(index);
    if (function != null) {
        setBoolean0(function, value, index, null);
    } else {
        indexedVariables.setQuick(index, function = booleanVarPool.next());
        ((BooleanBindVariable) function).value = value;
    }
}
Also used : Function(io.questdb.cairo.sql.Function)

Aggregations

Function (io.questdb.cairo.sql.Function)204 Test (org.junit.Test)101 UnaryFunction (io.questdb.griffin.engine.functions.UnaryFunction)39 IntList (io.questdb.std.IntList)33 Record (io.questdb.cairo.sql.Record)28 ToStrTimestampFunctionFactory (io.questdb.griffin.engine.functions.date.ToStrTimestampFunctionFactory)28 ToStrDateFunctionFactory (io.questdb.griffin.engine.functions.date.ToStrDateFunctionFactory)27 NotFunctionFactory (io.questdb.griffin.engine.functions.bool.NotFunctionFactory)26 InStrFunctionFactory (io.questdb.griffin.engine.functions.bool.InStrFunctionFactory)25 EqDoubleFunctionFactory (io.questdb.griffin.engine.functions.eq.EqDoubleFunctionFactory)25 EqIntFunctionFactory (io.questdb.griffin.engine.functions.eq.EqIntFunctionFactory)25 EqLongFunctionFactory (io.questdb.griffin.engine.functions.eq.EqLongFunctionFactory)25 OrFunctionFactory (io.questdb.griffin.engine.functions.bool.OrFunctionFactory)24 CastStrToGeoHashFunctionFactory (io.questdb.griffin.engine.functions.cast.CastStrToGeoHashFunctionFactory)23 CursorDereferenceFunctionFactory (io.questdb.griffin.engine.functions.catalogue.CursorDereferenceFunctionFactory)23 SysdateFunctionFactory (io.questdb.griffin.engine.functions.date.SysdateFunctionFactory)23 LengthStrFunctionFactory (io.questdb.griffin.engine.functions.str.LengthStrFunctionFactory)23 LengthSymbolFunctionFactory (io.questdb.griffin.engine.functions.str.LengthSymbolFunctionFactory)23 ToCharBinFunctionFactory (io.questdb.griffin.engine.functions.str.ToCharBinFunctionFactory)23 SwitchFunctionFactory (io.questdb.griffin.engine.functions.conditional.SwitchFunctionFactory)22