use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testFilterAndInterval.
@Test
public void testFilterAndInterval() throws Exception {
IntrinsicModel m = modelOf("bid > 100 and timestamp in (\"2014-01-01T12:30:00.000Z\", \"2014-01-02T12:30:00.000Z\")");
TestUtils.assertEquals("[{lo=2014-01-01T12:30:00.000000Z, hi=2014-01-02T12:30:00.000000Z}]", intervalToString(m.intervals));
assertFilter(m, "100bid>");
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesPositiveOverlapQuoteIndifference.
@Test
public void testListOfValuesPositiveOverlapQuoteIndifference() 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 sym in ('z')");
Assert.assertNull(m.filter);
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
Assert.assertEquals("[z]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsNull.
@Test
public void testEqualsNull() throws Exception {
IntrinsicModel m = modelOf("sym = null");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[null]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesOverlapWithNotClause3.
@Test
public void testListOfValuesOverlapWithNotClause3() 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 ('a', 'z', 'e'))");
Assert.assertEquals("[]", m.keyValues.toString());
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.griffin.lexer.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=");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[X]", m.keyValues.toString());
}
Aggregations