use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesOverlapWithNotClause2.
@Test
public void testListOfValuesOverlapWithNotClause2() 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', 'd', 'e'))");
Assert.assertNull(m.filter);
Assert.assertEquals("[z]", m.keyValues.toString());
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testThreeIntrinsics.
@Test
public void testThreeIntrinsics() throws Exception {
IntrinsicModel m;
m = modelOf("sym in ('a', 'b') and ex in ('c') and timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and bid > 100 and ask < 110");
assertFilter(m, "110ask<100bid>'c'exinandand");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[a,b]", m.keyValues.toString());
TestUtils.assertEquals("[{lo=2014-01-01T12:30:00.000000Z, hi=2014-01-02T12:30:00.000000Z}]", intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsZeroOverlapWithIn.
@Test
public void testEqualsZeroOverlapWithIn() throws Exception {
IntrinsicModel m = modelOf("sym in ('x','y') and sym = 'z'");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNotEqualsOverlapWithIn.
@Test
public void testNotEqualsOverlapWithIn() throws Exception {
IntrinsicModel m = modelOf("sym in ('x','y') and sym != 'y' and ex != 'blah'");
assertFilter(m, "'blah'ex!=");
Assert.assertEquals("[x]", m.keyValues.toString());
Assert.assertEquals("[8]", m.keyValuePositions.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNestedFunctionTest.
@Test
public void testNestedFunctionTest() throws Exception {
IntrinsicModel m = modelOf("substr(parse(x, 1, 3), 2, 4)");
Assert.assertNull(m.intervals);
assertFilter(m, "4231xparsesubstr");
}
Aggregations