use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testManualIntervalInverted.
@Test
public void testManualIntervalInverted() throws Exception {
IntrinsicModel m = modelOf("'2014-01-02T12:30:00.000Z' > timestamp and '2014-01-01T15:30:00.000Z' <= timestamp ");
TestUtils.assertEquals("[{lo=2014-01-01T15:30:00.000000Z, hi=2014-01-02T12:29:59.999999Z}]", intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testTwoDiffColLambdas.
@Test
public void testTwoDiffColLambdas() throws Exception {
IntrinsicModel m = modelOf("sym in (`xyz`) and ex in (`kkk`)");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals(1, m.keyValues.size());
TestUtils.assertEquals("xyz", m.keyValues.get(0));
Assert.assertTrue(m.keyValuesIsLambda);
Assert.assertNotNull(m.filter);
Assert.assertEquals(ExprNode.LAMBDA, m.filter.rhs.type);
}
use of com.questdb.griffin.lexer.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)");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals(1, m.keyValues.size());
TestUtils.assertEquals("xyz", m.keyValues.get(0));
Assert.assertTrue(m.keyValuesIsLambda);
Assert.assertNotNull(m.filter);
Assert.assertEquals("ex12in", GriffinParserTestUtils.toRpn(m.filter));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testListOfValuesNegativeOverlap.
@Test
public void testListOfValuesNegativeOverlap() 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 ('c')");
Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNotInIntervalNonConstant.
@Test
public void testNotInIntervalNonConstant() throws ParserException {
IntrinsicModel m = modelOf("not (timestamp in (x, 'abc')) and timestamp = '2015-05-11'");
TestUtils.assertEquals("[{lo=2015-05-11T00:00:00.000000Z, hi=2015-05-11T23:59:59.999999Z}]", intervalToString(m.intervals));
Assert.assertEquals(IntrinsicValue.UNDEFINED, m.intrinsicValue);
TestUtils.assertEquals("'abc'xtimestampinnot", toRpn(m.filter));
}
Aggregations