use of org.apache.flink.api.common.operators.DualInputSemanticProperties in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testDualHashPartitioningPreserved.
@Test
public void testDualHashPartitioningPreserved() {
DualInputSemanticProperties dprops = new DualInputSemanticProperties();
SemanticPropUtil.getSemanticPropsDualFromString(dprops, new String[] { "0;2;4" }, new String[] { "1->3;4->6;3->7" }, null, null, null, null, tupleInfo, tupleInfo, tupleInfo);
RequestedGlobalProperties gprops1 = new RequestedGlobalProperties();
RequestedGlobalProperties gprops2 = new RequestedGlobalProperties();
gprops1.setHashPartitioned(new FieldSet(2, 0, 4));
gprops2.setHashPartitioned(new FieldSet(3, 6, 7));
RequestedGlobalProperties filtered1 = gprops1.filterBySemanticProperties(dprops, 0);
RequestedGlobalProperties filtered2 = gprops2.filterBySemanticProperties(dprops, 1);
assertNotNull(filtered1);
assertEquals(PartitioningProperty.HASH_PARTITIONED, filtered1.getPartitioning());
assertNotNull(filtered1.getPartitionedFields());
assertEquals(3, filtered1.getPartitionedFields().size());
assertTrue(filtered1.getPartitionedFields().contains(0));
assertTrue(filtered1.getPartitionedFields().contains(2));
assertTrue(filtered1.getPartitionedFields().contains(4));
assertNull(filtered1.getOrdering());
assertNull(filtered1.getCustomPartitioner());
assertNull(filtered1.getDataDistribution());
assertNotNull(filtered2);
assertEquals(PartitioningProperty.HASH_PARTITIONED, filtered2.getPartitioning());
assertNotNull(filtered2.getPartitionedFields());
assertEquals(3, filtered2.getPartitionedFields().size());
assertTrue(filtered2.getPartitionedFields().contains(1));
assertTrue(filtered2.getPartitionedFields().contains(3));
assertTrue(filtered2.getPartitionedFields().contains(4));
assertNull(filtered2.getOrdering());
assertNull(filtered2.getCustomPartitioner());
assertNull(filtered2.getDataDistribution());
}
Aggregations