use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNotEqualsOverlapWithIn.
@Test
public void testNotEqualsOverlapWithIn() throws Exception {
IntrinsicModel m = modelOf("sym in ('x','y') and sym != 'y' and ex != 'blah'");
assertFilter(m, "'blah'ex!=");
Assert.assertEquals("[x]", m.keyValues.toString());
Assert.assertEquals("[8]", m.keyValuePositions.toString());
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testComplexInterval2.
@Test
public void testComplexInterval2() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;7d'");
Assert.assertEquals("[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-03-02T10:00:55.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertEquals("IntrinsicModel{keyValues=[], keyColumn='null', filter=null}", m.toString());
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsChoiceOfColumns.
@Test
public void testEqualsChoiceOfColumns() throws Exception {
IntrinsicModel m = modelOf("sym = 'X' and ex = 'Y'");
assertFilter(m, "'Y'ex=");
Assert.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[X]", m.keyValues.toString());
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testOr.
@Test
public void testOr() throws Exception {
IntrinsicModel m = modelOf("(sym = 'X' or sym = 'Y') and bid > 10");
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
assertFilter(m, "10bid>'Y'sym='X'sym=orand");
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceDay.
@Test
public void testIntervalSourceDay() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;30m;2d;5'");
Assert.assertEquals("[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-02-23T10:30:55.000Z},Interval{lo=2015-02-25T10:00:55.000Z, hi=2015-02-25T10:30:55.000Z},Interval{lo=2015-02-27T10:00:55.000Z, hi=2015-02-27T10:30:55.000Z},Interval{lo=2015-03-01T10:00:55.000Z, hi=2015-03-01T10:30:55.000Z},Interval{lo=2015-03-03T10:00:55.000Z, hi=2015-03-03T10:30:55.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
}
Aggregations