use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class GlobalPropertiesPushdownTest method testCustomPartitioningNotPushedDown.
@Test
public void testCustomPartitioningNotPushedDown() {
try {
RequestedGlobalProperties req = new RequestedGlobalProperties();
req.setCustomPartitioned(new FieldSet(3, 1), new MockPartitioner());
RequestedGlobalProperties pushedDown = req.filterBySemanticProperties(getAllPreservingSemProps(), 0);
assertTrue(pushedDown == null || pushedDown.isTrivial());
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testEraseAll1.
@Test
public void testEraseAll1() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
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 RequestedGlobalPropertiesFilteringTest method testNullProps.
@Test(expected = NullPointerException.class)
public void testNullProps() {
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setAnyPartitioning(new FieldSet(0, 1, 2));
rgProps.filterBySemanticProperties(null, 0);
}
use of org.apache.flink.api.common.operators.util.FieldSet in project flink by apache.
the class RequestedGlobalPropertiesFilteringTest method testAnyPartitioningPreserved1.
@Test
public void testAnyPartitioningPreserved1() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[] { "0;3;4" }, null, null, tupleInfo, tupleInfo);
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setAnyPartitioning(new FieldSet(0, 3, 4));
RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
assertNotNull(filtered);
assertEquals(PartitioningProperty.ANY_PARTITIONING, 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 testHashPartitioningErased.
@Test
public void testHashPartitioningErased() {
SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[] { "1;2" }, null, null, tupleInfo, tupleInfo);
RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
rgProps.setHashPartitioned(new FieldSet(0, 3, 4));
RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
assertNull(filtered);
}
Aggregations