use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesPositiveOverlap.
@Test
public void testListOfValuesPositiveOverlap() throws Exception {
IntrinsicModel m = modelOf("timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and sym in ('a', 'z') and sym in ('z')");
Assert.assertNull(m.filter);
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
Assert.assertEquals("[z]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testComplexInterval1.
@Test
public void testComplexInterval1() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00;2d'");
TestUtils.assertEquals("[{lo=2015-02-23T10:00:00.000000Z, hi=2015-02-25T10:00:59.999999Z}]", intervalToString(m.intervals));
Assert.assertEquals("IntrinsicModel{keyValues=[], keyColumn='null', filter=null}", m.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testLessNonConstant2.
@Test
public void testLessNonConstant2() throws ParserException {
IntrinsicModel m = modelOf("x < timestamp");
Assert.assertNull(m.intervals);
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
TestUtils.assertEquals("timestampx<", toRpn(m.filter));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalGreaterOrEq2.
@Test
public void testIntervalGreaterOrEq2() throws Exception {
IntrinsicModel m = modelOf("timestamp >= '2014-01-01T15:30:00.000Z' and timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z')");
TestUtils.assertEquals("[{lo=2014-01-01T15:30:00.000000Z, hi=2014-01-02T12:30:00.000000Z}]", intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalLessNoTimestamp.
@Test
public void testIntervalLessNoTimestamp() throws Exception {
IntrinsicModel m = noTimestampModelOf("timestamp < '2014-01-01T15:30:00.000Z'");
Assert.assertNull(m.intervals);
TestUtils.assertEquals("'2014-01-01T15:30:00.000Z'timestamp<", toRpn(m.filter));
}
Aggregations