public class TestPartitionExpression {
@Test
public void testPartitionStrategy() {
String expr = "hash(\"username\", \"username_part\", 2)";
PartitionExpression expression = new PartitionExpression(expr, true);
PartitionStrategy strategy = expression.evaluate();
List<FieldPartitioner> fieldPartitioners = strategy.getFieldPartitioners();
Assert.assertEquals(1, fieldPartitioners.size());
FieldPartitioner fp = fieldPartitioners.get(0);
Assert.assertEquals(HashFieldPartitioner.class, fp.getClass());
Assert.assertEquals("username", fp.getSourceName());