use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalGreater1.
@Test
public void testIntervalGreater1() throws Exception {
IntrinsicModel m = modelOf("timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and timestamp > '2014-01-01T15:30:00.000Z'");
Assert.assertEquals("[Interval{lo=2014-01-01T15:30:00.001Z, 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 testComplexInterval3.
@Test
public void testComplexInterval3() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;15s'");
Assert.assertEquals("[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-02-23T10:01:10.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 testEqualsZeroOverlapWithIn2.
@Test
public void testEqualsZeroOverlapWithIn2() throws Exception {
IntrinsicModel m = modelOf("sym = 'z' and sym in ('x','y')");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testDubiousLess.
@Test
public void testDubiousLess() throws Exception {
IntrinsicModel m = modelOf("ts < ts");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesOverlapWithNotClause.
@Test
public void testListOfValuesOverlapWithNotClause() throws Exception {
IntrinsicModel m = modelOf("timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and sym in ('a', 'z') and not (sym in ('c', 'd', 'e'))");
Assert.assertEquals("[a,z]", m.keyValues.toString());
Assert.assertNull(m.filter);
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
}
Aggregations