use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testAndBranchWithNonIndexedField.
@Test
public void testAndBranchWithNonIndexedField() throws Exception {
IntrinsicModel m = modelOf("timestamp in (\"2014-01-01T12:30:00.000Z\", \"2014-01-02T12:30:00.000Z\") and bid > 100");
TestUtils.assertEquals("[{lo=2014-01-01T12:30:00.000000Z, hi=2014-01-02T12:30:00.000000Z}]", intervalToString(m.intervals));
assertFilter(m, "100bid>");
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceMonth.
@Test
public void testIntervalSourceMonth() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;2h;2M;3'");
final String expected = "[{lo=2015-02-23T10:00:55.000000Z, hi=2015-02-23T12:00:55.000000Z}," + "{lo=2015-04-23T10:00:55.000000Z, hi=2015-04-23T12:00:55.000000Z}," + "{lo=2015-06-23T10:00:55.000000Z, hi=2015-06-23T12:00: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 testIntervalGreater2.
@Test
public void testIntervalGreater2() 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.000001Z, 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 testIntervalGreater5.
@Test
public void testIntervalGreater5() 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));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testOrNullSearch.
@Test
public void testOrNullSearch() throws Exception {
IntrinsicModel m = modelOf("sym = null or sym != null and ex != 'blah'");
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
assertFilter(m, "'blah'ex!=nullsym!=nullsym=orand");
Assert.assertEquals("[]", m.keyValues.toString());
Assert.assertEquals("[]", m.keyValuePositions.toString());
}
Aggregations