use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testContradictingNullSearch.
@Test
public void testContradictingNullSearch() throws Exception {
IntrinsicModel m = modelOf("sym = null and sym != null and ex != 'blah'");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
assertFilter(m, "'blah'ex!=");
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 testDubiousEquals.
@Test
public void testDubiousEquals() throws Exception {
IntrinsicModel m = modelOf("sum(ts) = sum(ts)");
Assert.assertNull(m.filter);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testConstVsLambda.
@Test
public void testConstVsLambda() throws Exception {
IntrinsicModel m = modelOf("ex 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("ex12in", TestUtils.toRpn(m.filter));
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testFilterMultipleKeysAndInterval.
@Test
public void testFilterMultipleKeysAndInterval() throws Exception {
IntrinsicModel m = modelOf("sym in (\"a\", \"b\", \"c\") 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,b,c]", m.keyValues.toString());
Assert.assertEquals("[8,13,18]", m.keyValuePositions.toString());
Assert.assertNull(m.filter);
}
use of com.questdb.parser.sql.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsChoiceOfColumns2.
@Test
public void testEqualsChoiceOfColumns2() throws Exception {
IntrinsicModel m = modelOf("ex = 'Y' and sym = 'X'");
assertFilter(m, "'Y'ex=");
Assert.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[X]", m.keyValues.toString());
}
Aggregations