use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testInNull.
@Test
public void testInNull() throws Exception {
IntrinsicModel m = modelOf("sym in ('X', null, 'Y')");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[X,null,Y]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNoIntrinsics.
@Test
public void testNoIntrinsics() throws Exception {
IntrinsicModel m = modelOf("a > 10 or b > 20");
Assert.assertNull(m.intervals);
Assert.assertNull(m.keyColumn);
assertFilter(m, "20b>10a>or");
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsOverlapWithIn2.
@Test
public void testEqualsOverlapWithIn2() throws Exception {
IntrinsicModel m = modelOf("sym = 'y' and sym in ('x','y')");
Assert.assertNull(m.filter);
Assert.assertEquals("[y]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceHour.
@Test
public void testIntervalSourceHour() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;10m;3h;10'");
final String expected = "[{lo=2015-02-23T10:00:55.000000Z, hi=2015-02-23T10:10:55.000000Z}," + "{lo=2015-02-23T13:00:55.000000Z, hi=2015-02-23T13:10:55.000000Z}," + "{lo=2015-02-23T16:00:55.000000Z, hi=2015-02-23T16:10:55.000000Z}," + "{lo=2015-02-23T19:00:55.000000Z, hi=2015-02-23T19:10:55.000000Z}," + "{lo=2015-02-23T22:00:55.000000Z, hi=2015-02-23T22:10:55.000000Z}," + "{lo=2015-02-24T01:00:55.000000Z, hi=2015-02-24T01:10:55.000000Z}," + "{lo=2015-02-24T04:00:55.000000Z, hi=2015-02-24T04:10:55.000000Z}," + "{lo=2015-02-24T07:00:55.000000Z, hi=2015-02-24T07:10:55.000000Z}," + "{lo=2015-02-24T10:00:55.000000Z, hi=2015-02-24T10:10:55.000000Z}," + "{lo=2015-02-24T13:00:55.000000Z, hi=2015-02-24T13:10:55.000000Z}]";
TestUtils.assertEquals(expected, intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testLambdaVsLambda.
@Test
public void testLambdaVsLambda() throws Exception {
IntrinsicModel m = modelOf("ex in (`abc`) and sym in (`xyz`)");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals(1, m.keyValues.size());
TestUtils.assertEquals("xyz", m.keyValues.get(0));
Assert.assertTrue(m.keyValuesIsLambda);
Assert.assertNotNull(m.filter);
Assert.assertEquals("ex`abc`in", GriffinParserTestUtils.toRpn(m.filter));
}
Aggregations