use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalGreater4.
@Test
public void testIntervalGreater4() throws Exception {
IntrinsicModel m = modelOf("timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and x() > timestamp");
TestUtils.assertEquals("[{lo=2014-01-01T12:30:00.000000Z, hi=2014-01-02T12:30:00.000000Z}]", intervalToString(m.intervals));
TestUtils.assertEquals("timestampx>", toRpn(m.filter));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testOr.
@Test
public void testOr() throws Exception {
IntrinsicModel m = modelOf("(sym = 'X' or sym = 'Y') and bid > 10");
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
assertFilter(m, "10bid>'Y'sym='X'sym=orand");
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalDontIntersect.
@Test
public void testIntervalDontIntersect() throws Exception {
// because of intervals being processed from right to left
// code will try to intersect 'not equal' will already existing positive interval
// result must be zero-overlap and FALSE model
IntrinsicModel m = modelOf("timestamp != '2015-05-11' and timestamp = '2015-05-11'");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNotInIntervalIntersect3.
@Test
public void testNotInIntervalIntersect3() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-05-11' and not (timestamp in ('2015-05-11T15:00:00.000Z', '2015-05-11T20:00:00.000Z')) and not (timestamp in ('2015-05-11T12:00:00.000Z', '2015-05-11T14:00:00.000Z')))");
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
TestUtils.assertEquals("[{lo=2015-05-11T00:00:00.000000Z, hi=2015-05-11T11:59:59.999999Z},{lo=2015-05-11T14:00:00.000001Z, hi=2015-05-11T14:59:59.999999Z},{lo=2015-05-11T20:00:00.000001Z, hi=2015-05-11T23:59:59.999999Z}]", intervalToString(m.intervals));
Assert.assertNull(m.filter);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testContradictingNullSearch2.
@Test
public void testContradictingNullSearch2() throws Exception {
IntrinsicModel m = modelOf("null = sym and null != sym and ex != 'blah'");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
assertFilter(m, "'blah'ex!=");
Assert.assertEquals("[]", m.keyValues.toString());
Assert.assertEquals("[]", m.keyValuePositions.toString());
}
Aggregations