use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testPreferredColumn2.
@Test
public void testPreferredColumn2() throws Exception {
IntrinsicModel m;
m = modelOf("ex in ('c') and sym in ('a', 'b') and timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and bid > 100 and ask < 110", "ex");
assertFilter(m, "110ask<100bid>'b''a'syminandand");
TestUtils.assertEquals("ex", m.keyColumn);
Assert.assertEquals("[c]", m.keyValues.toString());
TestUtils.assertEquals("[{lo=2014-01-01T12: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 testEqualsOverlapWithIn.
@Test
public void testEqualsOverlapWithIn() throws Exception {
IntrinsicModel m = modelOf("sym in ('x','y') and sym = 'y'");
Assert.assertNull(m.filter);
Assert.assertEquals("[y]", m.keyValues.toString());
Assert.assertEquals("[12]", m.keyValuePositions.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testPreferredColumn3.
@Test
public void testPreferredColumn3() throws Exception {
IntrinsicModel m;
m = modelOf("sym in ('a', 'b') and timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and bid > 100 and ask < 110", "ex");
assertFilter(m, "110ask<100bid>'b''a'syminandand");
Assert.assertNull(m.keyColumn);
TestUtils.assertEquals("[{lo=2014-01-01T12: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 testTwoIntervalSources.
@Test
public void testTwoIntervalSources() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2014-06-20T13:25:00.000Z;10m;2d;5' and timestamp = '2015-06-20T13:25:00.000Z;10m;2d;5'");
TestUtils.assertEquals("[]", intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testExactDate.
@Test
public void testExactDate() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-05-10T15:03:10.000Z' and timestamp < '2015-05-11T08:00:55.000Z'");
TestUtils.assertEquals("[{lo=2015-05-10T15:03:10.000000Z, hi=2015-05-10T15:03:10.000000Z}]", intervalToString(m.intervals));
Assert.assertNull(m.filter);
}
Aggregations