use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testPartitioningForQueryWithMissingFields.
@Test
public void testPartitioningForQueryWithMissingFields() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B");
Query query = createQuery(new BinaryExpression(new FieldExpression("A"), new ValueExpression("bar"), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("bar.-*"));
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testDefaultPartitioningForQueryWthImproperBinaryEquals.
@Test
public void testDefaultPartitioningForQueryWthImproperBinaryEquals() {
SimpleEqualityPartitioner partitioner = createPartitioner("A");
Query query = createQuery(new BinaryExpression(new FieldExpression("A"), new FieldExpression("B"), Operation.EQUALS), new BinaryExpression(new FieldExpression("A"), new FieldExpression("B"), Operation.EQUALS), new BinaryExpression(new ValueExpression("foo"), new ValueExpression("bar"), Operation.EQUALS), new BinaryExpression(new ListExpression(emptyList()), new ListExpression(emptyList()), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("*"));
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testPartitioningForQueryWithNullCheckedFields.
@Test
public void testPartitioningForQueryWithNullCheckedFields() {
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 testDefaultPartitioningQueryWithNoEqualityFilters.
@Test
public void testDefaultPartitioningQueryWithNoEqualityFilters() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B");
Query query = createQuery(new FieldExpression("abc"));
Assert.assertEquals(partitioner.getKeys(query), singleton("*-*"));
}
use of com.yahoo.bullet.query.Query in project bullet-core by yahoo.
the class SimpleEqualityPartitionerTest method testDefaultPartitioningQueryWithUnrelatedFilters.
@Test
public void testDefaultPartitioningQueryWithUnrelatedFilters() {
SimpleEqualityPartitioner partitioner = createPartitioner("A", "B");
Query query = createQuery(new BinaryExpression(new FieldExpression("C"), new ValueExpression("bar"), Operation.EQUALS), new BinaryExpression(new FieldExpression("D"), new ValueExpression("baz"), Operation.EQUALS));
Assert.assertEquals(partitioner.getKeys(query), singleton("*-*"));
}
Aggregations