use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testAndBranchWithNonIndexedField.
@Test
public void testAndBranchWithNonIndexedField() throws Exception {
IntrinsicModel m = modelOf("timestamp in (\"2014-01-01T12:30:00.000Z\", \"2014-01-02T12:30:00.000Z\") and bid > 100");
Assert.assertEquals("[Interval{lo=2014-01-01T12:30:00.000Z, hi=2014-01-02T12:30:00.000Z}]", IntervalCompiler.asIntervalStr(m.intervals));
assertFilter(m, "100bid>");
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testConstVsLambda2.
@Test
public void testConstVsLambda2() throws Exception {
IntrinsicModel m = modelOf("sym in (1,2) and sym in (`xyz`)");
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("sym12in", TestUtils.toRpn(m.filter));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testOrNullSearch.
@Test
public void testOrNullSearch() throws Exception {
IntrinsicModel m = modelOf("sym = null or sym != null and ex != 'blah'");
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
assertFilter(m, "'blah'ex!=nullsym!=nullsym=orand");
Assert.assertEquals("[]", m.keyValues.toString());
Assert.assertEquals("[]", m.keyValuePositions.toString());
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testTwoExactSameDates.
@Test
public void testTwoExactSameDates() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-05-10T15:03:10.000Z' and timestamp = '2015-05-10T15:03:10.000Z' and timestamp = '2015-05-11'");
Assert.assertEquals("[]", IntervalCompiler.asIntervalStr(m.intervals));
Assert.assertNull(m.filter);
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testFilterOnIndexedFieldAndInterval.
@Test
public void testFilterOnIndexedFieldAndInterval() throws Exception {
IntrinsicModel m = modelOf("sym in ('a') 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.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[a]", m.keyValues.toString());
Assert.assertNull(m.filter);
}
Aggregations