use of io.questdb.griffin.engine.functions.constants.DoubleConstant in project questdb by bluestreak01.
the class EqDoubleFunctionFactoryTest method testRightNaNDate.
@Test
public void testRightNaNDate() throws SqlException {
FunctionFactory factory = getFunctionFactory();
ObjList<Function> args = new ObjList<>();
args.add(new DateConstant(10000L));
args.add(new DoubleConstant(Double.NaN));
IntList argPositions = new IntList();
argPositions.add(1);
argPositions.add(2);
Function function = factory.newInstance(4, args, argPositions, configuration, sqlExecutionContext);
Assert.assertFalse(function.getBool(null));
}
use of io.questdb.griffin.engine.functions.constants.DoubleConstant in project questdb by bluestreak01.
the class EqDoubleFunctionFactoryTest method testLeftNaNFloatNaN.
@Test
public void testLeftNaNFloatNaN() throws SqlException {
FunctionFactory factory = getFunctionFactory();
ObjList<Function> args = new ObjList<>();
args.add(new FloatConstant(Float.NaN));
args.add(new DoubleConstant(Double.NaN));
IntList argPositions = new IntList();
argPositions.add(1);
argPositions.add(2);
Function function = factory.newInstance(4, args, argPositions, configuration, sqlExecutionContext);
Assert.assertTrue(function.getBool(null));
Assert.assertTrue(function.isConstant());
}
use of io.questdb.griffin.engine.functions.constants.DoubleConstant in project questdb by bluestreak01.
the class EqDoubleFunctionFactoryTest method testRightNaNFloat.
@Test
public void testRightNaNFloat() throws SqlException {
FunctionFactory factory = getFunctionFactory();
ObjList<Function> args = new ObjList<>();
args.add(new DoubleConstant(Double.NaN));
args.add(new FloatConstant(5.1f) {
@Override
public boolean isConstant() {
return false;
}
});
IntList argPositions = new IntList();
argPositions.add(2);
argPositions.add(1);
Function function = factory.newInstance(4, args, argPositions, configuration, sqlExecutionContext);
Assert.assertFalse(function.getBool(null));
Assert.assertFalse(function.isConstant());
}
use of io.questdb.griffin.engine.functions.constants.DoubleConstant in project questdb by bluestreak01.
the class EqDoubleFunctionFactoryTest method testLeftNaNFloat.
@Test
public void testLeftNaNFloat() throws SqlException {
FunctionFactory factory = getFunctionFactory();
ObjList<Function> args = new ObjList<>();
args.add(new FloatConstant(3.4f));
args.add(new DoubleConstant(Double.NaN));
IntList argPositions = new IntList();
argPositions.add(1);
argPositions.add(2);
Function function = factory.newInstance(4, args, argPositions, configuration, sqlExecutionContext);
Assert.assertFalse(function.getBool(null));
Assert.assertTrue(function.isConstant());
}
use of io.questdb.griffin.engine.functions.constants.DoubleConstant in project questdb by bluestreak01.
the class EqDoubleFunctionFactoryTest method testRightNaNDateNaN.
@Test
public void testRightNaNDateNaN() throws SqlException {
FunctionFactory factory = getFunctionFactory();
ObjList<Function> args = new ObjList<>();
args.add(new DateConstant(Numbers.LONG_NaN));
args.add(new DoubleConstant(Double.NaN));
IntList argPositions = new IntList();
argPositions.add(1);
argPositions.add(2);
Function function = factory.newInstance(4, args, argPositions, configuration, sqlExecutionContext);
Assert.assertTrue(function.getBool(null));
Assert.assertTrue(function.isConstant());
}
Aggregations