use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method createQuery.
private Query createQuery() {
Query query = new Query(new Projection(), null, new Raw(null), null, new Window(), null);
query.configure(config);
return query;
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method createQuery.
private Query createQuery(Expression filter) {
Query query = new Query(new Projection(), filter, new Raw(null), null, new Window(), null);
query.configure(config);
return query;
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testDefaultPartitioningQueryWithNullEqualityFilters.
@Test
public void testDefaultPartitioningQueryWithNullEqualityFilters() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B");
Query query = createQuery(new BinaryExpression(new FieldExpression("A"), new ValueExpression(null), Operation.EQUALS), new BinaryExpression(new FieldExpression("B"), new ValueExpression(null), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("null-null"));
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testPartitioningForQueryWithAllFieldsOperandsFlipped.
@Test
public void testPartitioningForQueryWithAllFieldsOperandsFlipped() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B", "C");
Query query = createQuery(new BinaryExpression(new ValueExpression("bar"), new FieldExpression("A"), Operation.EQUALS), new BinaryExpression(new ValueExpression("baz"), new FieldExpression("B"), Operation.EQUALS), new BinaryExpression(new ValueExpression("qux"), new FieldExpression("C"), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("bar.-baz.-qux."));
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testPartitioningForQueryWithNestedFields.
@Test
public void testPartitioningForQueryWithNestedFields() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B", "C", "D.e");
Query query = createQuery(new BinaryExpression(new FieldExpression("A"), new ValueExpression("bar"), Operation.EQUALS), new BinaryExpression(new FieldExpression("B"), new ValueExpression("quux"), Operation.EQUALS), new BinaryExpression(new FieldExpression("C"), new ValueExpression("qux"), Operation.EQUALS), new BinaryExpression(new FieldExpression("D", "e"), new ValueExpression("norf"), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("bar.-quux.-qux.-norf."));
}
Aggregations