use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testSingleQuoteInterval.
@Test
public void testSingleQuoteInterval() throws Exception {
IntrinsicModel m = modelOf("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));
Assert.assertNull(m.filter);
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testIntervalSourceSec.
@Test
public void testIntervalSourceSec() throws Exception {
IntrinsicModel m = modelOf("timestamp = '2015-02-23T10:00:55.000Z;5s;30s;5'");
final String expected = "[{lo=2015-02-23T10:00:55.000000Z, hi=2015-02-23T10:01:00.000000Z}," + "{lo=2015-02-23T10:01:25.000000Z, hi=2015-02-23T10:01:30.000000Z}," + "{lo=2015-02-23T10:01:55.000000Z, hi=2015-02-23T10:02:00.000000Z}," + "{lo=2015-02-23T10:02:25.000000Z, hi=2015-02-23T10:02:30.000000Z}," + "{lo=2015-02-23T10:02:55.000000Z, hi=2015-02-23T10:03:00.000000Z}]";
TestUtils.assertEquals(expected, intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testInVsEqualInterval.
@Test
public void testInVsEqualInterval() throws Exception {
IntrinsicModel m = modelOf("timestamp in ('2014-01-01T12:30:00.000Z', '2014-01-02T12:30:00.000Z') and timestamp = '2014-01-01'");
Assert.assertNull(m.filter);
TestUtils.assertEquals("[{lo=2014-01-01T12:30:00.000000Z, hi=2014-01-01T23:59:59.999999Z}]", intervalToString(m.intervals));
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testEqualsChoiceOfColumns.
@Test
public void testEqualsChoiceOfColumns() throws Exception {
IntrinsicModel m = modelOf("sym = 'X' and ex = 'Y'");
assertFilter(m, "'Y'ex=");
TestUtils.assertEquals("sym", m.keyColumn);
Assert.assertEquals("[X]", m.keyValues.toString());
}
use of com.questdb.griffin.lexer.model.IntrinsicModel in project questdb by bluestreak01.
the class QueryFilterAnalyserTest method testNotEqualsDoesNotOverlapWithIn.
@Test
public void testNotEqualsDoesNotOverlapWithIn() throws Exception {
IntrinsicModel m = modelOf("sym in ('x','y') and sym != 'z' and ex != 'blah'");
assertFilter(m, "'blah'ex!=");
Assert.assertEquals("[x,y]", m.keyValues.toString());
Assert.assertEquals("[8,12]", m.keyValuePositions.toString());
}
Aggregations