use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceSec.
@Test
public void testIntervalSourceSec() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;5s;30s;5'");
final String expected = "[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-02-23T10:01:00.000Z}," + "Interval{lo=2015-02-23T10:01:25.000Z, hi=2015-02-23T10:01:30.000Z}," + "Interval{lo=2015-02-23T10:01:55.000Z, hi=2015-02-23T10:02:00.000Z}," + "Interval{lo=2015-02-23T10:02:25.000Z, hi=2015-02-23T10:02:30.000Z}," + "Interval{lo=2015-02-23T10:02:55.000Z, hi=2015-02-23T10:03:00.000Z}]";
Assert.assertEquals(expected, IntervalCompiler.asIntervalStr(m.intervals));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceYear.
@Test
public void testIntervalSourceYear() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;1d;1y;5'");
final String expected = "[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-02-24T10:00:55.000Z}," + "Interval{lo=2016-02-23T10:00:55.000Z, hi=2016-02-24T10:00:55.000Z}," + "Interval{lo=2017-02-23T10:00:55.000Z, hi=2017-02-24T10:00:55.000Z}," + "Interval{lo=2018-02-23T10:00:55.000Z, hi=2018-02-24T10:00:55.000Z}," + "Interval{lo=2019-02-23T10:00:55.000Z, hi=2019-02-24T10:00:55.000Z}]";
Assert.assertEquals(expected, IntervalCompiler.asIntervalStr(m.intervals));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testDubiousGreater.
@Test
public void testDubiousGreater() 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 testIntervalGreaterOrEq1.
@Test
public void testIntervalGreaterOrEq1() 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.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 testComplexInterval1.
@Test
public void testComplexInterval1() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00;2d'");
Assert.assertEquals("[Interval{lo=2015-02-23T10:00:00.000Z, hi=2015-02-25T10:00:59.999Z}]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertEquals("IntrinsicModel{keyValues=[], keyColumn='null', filter=null}", m.toString());
}
Aggregations