use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testExactDateVsInterval.
@Test
public void testExactDateVsInterval() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-05-10T15:03:10.000Z' and timestamp = '2015-05-11'");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
Assert.assertNull(m.filter);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsNull.
@Test
public void testEqualsNull() throws Exception {
IntrinsicModel m = modelOf("sym = null");
Assert.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[null]", m.keyValues.toString());
}
use of com.questdb.parser.sql.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);
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 testLambdaVsConst.
@Test
public void testLambdaVsConst() throws Exception {
IntrinsicModel m = modelOf("sym in (`xyz`) and ex in (1,2)");
Assert.assertEquals("sym", m.keyColumn);
Assert.assertEquals(1, m.keyValues.size());
Assert.assertEquals("xyz", m.keyValues.get(0));
Assert.assertTrue(m.keyValuesIsLambda);
Assert.assertNotNull(m.filter);
Assert.assertEquals("ex12in", TestUtils.toRpn(m.filter));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testComplexInterval5.
@Test
public void testComplexInterval5() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;30m' and timestamp != '2015-02-23T10:10:00.000Z'");
Assert.assertEquals("[Interval{lo=2015-02-23T10:00:55.000Z, hi=2015-02-23T10:09:59.999Z},Interval{lo=2015-02-23T10:10:00.001Z, hi=2015-02-23T10:30:55.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertEquals("IntrinsicModel{keyValues=[], keyColumn='null', filter=null}", m.toString());
}
Aggregations