use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testHashPartitioningPreserved1.
@Test
public void testHashPartitioningPreserved1() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[] { "0;3;4" }, null, null, tupleInfo, tupleInfo);
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setHashPartitioned(new FieldSet(0, 3, 4));
RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
assertNotNull(filtered);
assertEquals(PartitioningProperty.HASH_PARTITIONED, filtered.getPartitioning());
assertNotNull(filtered.getPartitionedFields());
assertEquals(3, filtered.getPartitionedFields().size());
assertTrue(filtered.getPartitionedFields().contains(0));
assertTrue(filtered.getPartitionedFields().contains(3));
assertTrue(filtered.getPartitionedFields().contains(4));
assertNull(filtered.getDataDistribution());
assertNull(filtered.getCustomPartitioner());
assertNull(filtered.getOrdering());
}
use of org.apache.flink.api.common.operators.util.FieldSet 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());
}
use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testHashPartitioningPreserved2.
@Test
public void testHashPartitioningPreserved2() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[] { "2->0;1->3;7->4" }, null, null, tupleInfo, tupleInfo);
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setHashPartitioned(new FieldSet(0, 3, 4));
RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
assertNotNull(filtered);
assertEquals(PartitioningProperty.HASH_PARTITIONED, filtered.getPartitioning());
assertNotNull(filtered.getPartitionedFields());
assertEquals(3, filtered.getPartitionedFields().size());
assertTrue(filtered.getPartitionedFields().contains(1));
assertTrue(filtered.getPartitionedFields().contains(2));
assertTrue(filtered.getPartitionedFields().contains(7));
assertNull(filtered.getDataDistribution());
assertNull(filtered.getCustomPartitioner());
assertNull(filtered.getOrdering());
}
use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testEraseAll2.
@Test
public void testEraseAll2() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[] { "3;4" }, null, null, tupleInfo, tupleInfo);
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setAnyPartitioning(new FieldSet(0, 1, 2));
RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
assertNull(filtered);
}
use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedLocalPropertiesFilteringTest method testAllErased.
@Test
public void testAllErased() {
SingleInputSemanticProperties sProps = new SingleInputSemanticProperties();
RequestedLocalProperties rlProp = new RequestedLocalProperties();
rlProp.setGroupedFields(new FieldSet(0, 2, 3));
RequestedLocalProperties filtered = rlProp.filterBySemanticProperties(sProps, 0);
assertNull(filtered);
}
Aggregations