Search in sources :

Example 46 with IntrinsicModel

use of com.questdb.griffin.lexer.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());
}
Also used : IntrinsicModel(com.questdb.griffin.lexer.model.IntrinsicModel) AbstractCairoTest(com.questdb.cairo.AbstractCairoTest)

Example 47 with IntrinsicModel

use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.

the class QueryFilterAnalyserTest method testEqualsZeroOverlapWithIn2.

@Test
public void testEqualsZeroOverlapWithIn2() throws Exception {
    IntrinsicModel m = modelOf("sym = 'z' and sym in ('x','y')");
    Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
Also used : IntrinsicModel(com.questdb.griffin.lexer.model.IntrinsicModel) AbstractCairoTest(com.questdb.cairo.AbstractCairoTest)

Example 48 with IntrinsicModel

use of com.questdb.griffin.lexer.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'");
    TestUtils.assertEquals("[]", intervalToString(m.intervals));
    Assert.assertNull(m.filter);
    Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
Also used : IntrinsicModel(com.questdb.griffin.lexer.model.IntrinsicModel) AbstractCairoTest(com.questdb.cairo.AbstractCairoTest)

Example 49 with IntrinsicModel

use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.

the class QueryFilterAnalyserTest method testExactDateVsInterval.

@Test
public void testExactDateVsInterval() throws Exception {
    IntrinsicModel m = modelOf("timestamp = '2015-05-10T15:03:10.000Z' and timestamp = '2015-05-11'");
    Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
    Assert.assertNull(m.filter);
}
Also used : IntrinsicModel(com.questdb.griffin.lexer.model.IntrinsicModel) AbstractCairoTest(com.questdb.cairo.AbstractCairoTest)

Example 50 with IntrinsicModel

use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.

the class QueryFilterAnalyserTest method testDubiousNotEquals.

@Test
public void testDubiousNotEquals() throws Exception {
    IntrinsicModel m = modelOf("ts != ts");
    Assert.assertEquals(IntrinsicValue.FALSE, m.intrinsicValue);
}
Also used : IntrinsicModel(com.questdb.griffin.lexer.model.IntrinsicModel) AbstractCairoTest(com.questdb.cairo.AbstractCairoTest)

Aggregations

IntrinsicModel (com.questdb.griffin.lexer.model.IntrinsicModel)86 AbstractCairoTest (com.questdb.cairo.AbstractCairoTest)85 GriffinParserTestUtils.intervalToString (com.questdb.griffin.lexer.GriffinParserTestUtils.intervalToString)5 ExprNode (com.questdb.griffin.common.ExprNode)1