use of uk.gov.gchq.gaffer.store.operation.handler.join.match.ElementMatch in project Gaffer by gchq.
the class JoinHandlerTest method shouldSetInputToNewArrayListWhenNull.
@Test
public void shouldSetInputToNewArrayListWhenNull() throws OperationException {
// Given
final JoinHandler handler = new JoinHandler();
final Join joinOp = new Join.Builder<>().joinType(JoinType.FULL).matchMethod(new ElementMatch()).matchKey(MatchKey.LEFT).build();
// When
handler.doOperation(joinOp, context, store);
// Then
assertTrue(joinOp.getInput().equals(new ArrayList<>()));
}
use of uk.gov.gchq.gaffer.store.operation.handler.join.match.ElementMatch in project Gaffer by gchq.
the class JoinIT method shouldRightKeyInnerJoin.
@Test
public void shouldRightKeyInnerJoin() throws OperationException {
// Given
final List<Element> expectedResults = innerJoinElements;
Join<Element> joinOp = new Join.Builder<Element>().input(inputElements).operation(rhsGetElementsOperation).joinType(JoinType.INNER).matchKey(MatchKey.RIGHT).matchMethod(new ElementMatch(TestPropertyNames.COUNT)).flatten(false).build();
// When
final Iterable<? extends MapTuple> results = graph.execute(joinOp, getUser());
// Then
assertKeysExist(expectedResults, results, MatchKey.RIGHT);
}
use of uk.gov.gchq.gaffer.store.operation.handler.join.match.ElementMatch in project Gaffer by gchq.
the class JoinIT method shouldLeftKeyFullJoin.
@Test
public void shouldLeftKeyFullJoin() throws OperationException {
// Given
final List<Element> expectedResults = new ArrayList<>(inputElements);
Join<Element> joinOp = new Join.Builder<Element>().input(inputElements).operation(rhsGetElementsOperation).joinType(JoinType.FULL).matchKey(MatchKey.LEFT).matchMethod(new ElementMatch(TestPropertyNames.COUNT)).flatten(false).build();
// When
final Iterable<? extends MapTuple> results = graph.execute(joinOp, getUser());
// Then
assertKeysExist(expectedResults, results, MatchKey.LEFT);
}
use of uk.gov.gchq.gaffer.store.operation.handler.join.match.ElementMatch in project Gaffer by gchq.
the class JoinIT method shouldRightKeyFullJoin.
@Test
public void shouldRightKeyFullJoin() throws OperationException {
// Given
final List<Element> expectedResults = innerJoinElements;
expectedResults.add(getJoinEntity(TestGroups.ENTITY_3, 8));
Join<Element> joinOp = new Join.Builder<Element>().input(inputElements).operation(rhsGetElementsOperation).joinType(JoinType.FULL).matchKey(MatchKey.RIGHT).matchMethod(new ElementMatch(TestPropertyNames.COUNT)).flatten(false).build();
// When
final Iterable<? extends MapTuple> results = graph.execute(joinOp, getUser());
// Then
assertKeysExist(expectedResults, results, MatchKey.RIGHT);
}
use of uk.gov.gchq.gaffer.store.operation.handler.join.match.ElementMatch in project Gaffer by gchq.
the class JoinIT method testNestedViewCompletedIfNotSupplied.
@Test
public void testNestedViewCompletedIfNotSupplied() throws Exception {
// Given
Join<Element> joinOp = new Join.Builder<Element>().input(inputElements).operation(new GetAllElements()).joinType(JoinType.INNER).matchKey(MatchKey.LEFT).matchMethod(new ElementMatch(TestPropertyNames.COUNT)).build();
// When / Then - no exceptions
graph.execute(joinOp, getUser());
}
Aggregations