use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class SubqueryFilterSplitterTest method testCompoundSplitByOr.
@Test
public void testCompoundSplitByOr() throws Exception {
FilterExpression expression = parse("(countryUnSeats>3;overallRating=='Foo'),(overallRating=='Bar';overallRating=='Blah')");
SubqueryFilterSplitter.SplitFilter splitExpressions = SubqueryFilterSplitter.splitFilter(metaDataStore, expression);
assertEquals(expression, splitExpressions.getOuter());
assertNull(splitExpressions.getInner());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class SubqueryFilterSplitterTest method testSplitByAnd.
@Test
public void testSplitByAnd() throws Exception {
FilterExpression expression = parse("countryUnSeats>3;overallRating=='Foo'");
FilterExpression expectedOuter = parse("countryUnSeats>3");
FilterExpression expectedInner = parse("overallRating=='Foo'");
SubqueryFilterSplitter.SplitFilter splitExpressions = SubqueryFilterSplitter.splitFilter(metaDataStore, expression);
assertEquals(expectedOuter, splitExpressions.getOuter());
assertEquals(expectedInner, splitExpressions.getInner());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class SubqueryFilterSplitterTest method testSplitByOr.
@Test
public void testSplitByOr() throws Exception {
FilterExpression expression = parse("countryUnSeats>3,overallRating=='Foo'");
SubqueryFilterSplitter.SplitFilter splitExpressions = SubqueryFilterSplitter.splitFilter(metaDataStore, expression);
assertEquals(expression, splitExpressions.getOuter());
assertNull(splitExpressions.getInner());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class SubqueryFilterSplitterTest method testSinglePredicateWithJoin.
@Test
public void testSinglePredicateWithJoin() throws Exception {
FilterExpression expression = parse("countryUnSeats>3");
SubqueryFilterSplitter.SplitFilter splitExpressions = SubqueryFilterSplitter.splitFilter(metaDataStore, expression);
assertNull(splitExpressions.getInner());
assertEquals(expression, splitExpressions.getOuter());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class FilterTranslatorTest method testComplexAttributeAlias.
@Test
public void testComplexAttributeAlias() throws Exception {
FilterExpression expression = dialect.parseFilterExpression("price.total>=10", ClassType.of(Book.class), true);
FilterTranslator filterOp = new FilterTranslator(dictionary);
String actual = filterOp.apply(expression, true);
actual = actual.replaceAll(":\\w+", ":XXX");
assertEquals("example_Book.price.total >= :XXX", actual);
}
Aggregations