use of uk.gov.gchq.gaffer.spark.operation.scalardd.GetRDDOfElements in project Gaffer by gchq.
the class FilterToOperationConverterTest method testSpecifyDestination.
@Test
public void testSpecifyDestination() {
final Schema schema = getSchema();
final SparkSession sparkSession = SparkSessionProvider.getSparkSession();
final Filter[] filters = new Filter[1];
filters[0] = new EqualTo(SchemaToStructTypeConverter.DST_COL_NAME, "0");
final FiltersToOperationConverter converter = new FiltersToOperationConverter(getViewFromSchema(schema), schema, filters);
final Operation operation = converter.getOperation();
assertTrue(operation instanceof GetRDDOfElements);
assertEquals(0, ((GraphFilters) operation).getView().getEntityGroups().size());
assertEquals(EDGE_GROUPS, ((GraphFilters) operation).getView().getEdgeGroups());
final Set<EntityId> seeds = new HashSet<>();
for (final Object seed : ((GetRDDOfElements) operation).getInput()) {
seeds.add((EntitySeed) seed);
}
assertEquals(Collections.singleton(new EntitySeed("0")), seeds);
}
Aggregations