use of com.apple.foundationdb.record.metadata.expressions.SplitKeyExpression in project fdb-record-layer by FoundationDB.
the class KeyExpressionTest method testSplit.
@Test
public void testSplit() throws Exception {
final SplitKeyExpression split = field("repeat_me", FanType.FanOut).split(3);
split.validate(TestScalarFieldAccess.getDescriptor());
assertEquals(Arrays.asList(concatenate("one", "two", "three"), concatenate("four", "five", "six"), concatenate("seven", "eight", "nine")), evaluate(split, numbers));
assertEquals(Collections.emptyList(), evaluate(split, null));
}
use of com.apple.foundationdb.record.metadata.expressions.SplitKeyExpression in project fdb-record-layer by FoundationDB.
the class KeyExpressionTest method testSplitBad.
@Test
public void testSplitBad() throws Exception {
assertThrows(RecordCoreException.class, () -> {
final SplitKeyExpression split = field("repeat_me", FanType.FanOut).split(4);
split.validate(TestScalarFieldAccess.getDescriptor());
evaluate(split, numbers);
});
}
Aggregations