use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testLiteralInListOfValues.
@Test
public void testLiteralInListOfValues() throws Exception {
IntrinsicModel m = modelOf("sym in (\"a\", z) and timestamp in (\"2014-01-01T12:30:00.000Z\", \"2014-01-02T12:30:00.000Z\")");
Assert.assertEquals("[Interval{lo=2014-01-01T12:30:00.000Z, hi=2014-01-02T12:30:00.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertNull(m.keyColumn);
assertFilter(m, "z\"a\"symin");
}
use of com.questdb.parser.sql.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");
Assert.assertEquals("ex", m.keyColumn);
Assert.assertEquals("[c]", m.keyValues.toString());
Assert.assertEquals("[Interval{lo=2014-01-01T12:30:00.000Z, hi=2014-01-02T12:30:00.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testManualIntervalInverted.
@Test
public void testManualIntervalInverted() throws Exception {
IntrinsicModel m = modelOf("'2014-01-02T12:30:00.000Z' > timestamp and '2014-01-01T15:30:00.000Z' <= timestamp ");
Assert.assertEquals("[Interval{lo=2014-01-01T15:30:00.000Z, hi=2014-01-02T12:29:59.999Z}]", IntervalCompiler.asIntervalStr(m.intervals));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testLiteralInInterval.
@Test
public void testLiteralInInterval() throws Exception {
IntrinsicModel m = modelOf("timestamp in (\"2014-01-01T12:30:00.000Z\", c)");
Assert.assertNull(m.intervals);
assertFilter(m, "c\"2014-01-01T12:30:00.000Z\"timestampin");
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testSimpleInterval.
@Test
public void testSimpleInterval() throws Exception {
IntrinsicModel m = modelOf("timestamp in (\"2014-01-01T12:30:00.000Z\", \"2014-01-02T12:30:00.000Z\")");
Assert.assertEquals("[Interval{lo=2014-01-01T12:30:00.000Z, hi=2014-01-02T12:30:00.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertNull(m.filter);
}
Aggregations