Search in sources :

Example 76 with IntrinsicModel

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

Example 77 with IntrinsicModel

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

Example 78 with IntrinsicModel

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

Example 79 with IntrinsicModel

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

Example 80 with IntrinsicModel

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());
}
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