use of io.questdb.std.IntList in project questdb by bluestreak01.
the class FunctionParserTest method testImplicitConstantLong.
@Test
public void testImplicitConstantLong() throws SqlException {
functions.add(new FunctionFactory() {
@Override
public String getSignature() {
return "x()";
}
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration1, SqlExecutionContext sqlExecutionContext) {
return new LongFunction() {
@Override
public long getLong(Record rec) {
return 0;
}
@Override
public boolean isConstant() {
return true;
}
};
}
});
Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser());
Assert.assertTrue(function instanceof LongConstant);
}
use of io.questdb.std.IntList in project questdb by bluestreak01.
the class FunctionParserTest method testImplicitConstantTimestamp.
@Test
public void testImplicitConstantTimestamp() throws SqlException {
functions.add(new FunctionFactory() {
@Override
public String getSignature() {
return "x()";
}
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration1, SqlExecutionContext sqlExecutionContext) {
return new TimestampFunction() {
@Override
public long getTimestamp(Record rec) {
return 0;
}
@Override
public boolean isConstant() {
return true;
}
};
}
});
Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser());
Assert.assertTrue(function instanceof TimestampConstant);
}
use of io.questdb.std.IntList in project questdb by bluestreak01.
the class FunctionParserTest method testImplicitConstantByte.
@Test
public void testImplicitConstantByte() throws SqlException {
functions.add(new FunctionFactory() {
@Override
public String getSignature() {
return "x()";
}
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration1, SqlExecutionContext sqlExecutionContext) {
return new ByteFunction() {
@Override
public byte getByte(Record rec) {
return 0;
}
@Override
public boolean isConstant() {
return true;
}
};
}
});
Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser());
Assert.assertTrue(function instanceof ByteConstant);
}
use of io.questdb.std.IntList in project questdb by bluestreak01.
the class FunctionParserTest method testImplicitConstantFloat.
@Test
public void testImplicitConstantFloat() throws SqlException {
functions.add(new FunctionFactory() {
@Override
public String getSignature() {
return "x()";
}
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration1, SqlExecutionContext sqlExecutionContext) {
return new FloatFunction() {
@Override
public float getFloat(Record rec) {
return 0;
}
@Override
public boolean isConstant() {
return true;
}
};
}
});
Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser());
Assert.assertTrue(function instanceof FloatConstant);
}
use of io.questdb.std.IntList in project questdb by bluestreak01.
the class FunctionParserTest method testImplicitConstantBoolean.
@Test
public void testImplicitConstantBoolean() throws SqlException {
functions.add(new FunctionFactory() {
@Override
public String getSignature() {
return "x()";
}
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration1, SqlExecutionContext sqlExecutionContext) {
return new BooleanFunction() {
@Override
public boolean getBool(Record rec) {
return false;
}
@Override
public boolean isConstant() {
return true;
}
};
}
});
Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser());
Assert.assertTrue(function instanceof BooleanConstant);
}
Aggregations