Search in sources :

Example 16 with FieldSet

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());
    }
}
Also used : FieldSet(org.apache.flink.api.common.operators.util.FieldSet) Test(org.junit.Test)

Example 17 with FieldSet

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);
}
Also used : FieldSet(org.apache.flink.api.common.operators.util.FieldSet) SingleInputSemanticProperties(org.apache.flink.api.common.operators.SingleInputSemanticProperties) Test(org.junit.Test)

Example 18 with FieldSet

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);
}
Also used : FieldSet(org.apache.flink.api.common.operators.util.FieldSet) Test(org.junit.Test)

Example 19 with FieldSet

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());
}
Also used : FieldSet(org.apache.flink.api.common.operators.util.FieldSet) SingleInputSemanticProperties(org.apache.flink.api.common.operators.SingleInputSemanticProperties) Test(org.junit.Test)

Example 20 with FieldSet

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);
}
Also used : FieldSet(org.apache.flink.api.common.operators.util.FieldSet) SingleInputSemanticProperties(org.apache.flink.api.common.operators.SingleInputSemanticProperties) Test(org.junit.Test)

Aggregations

FieldSet (org.apache.flink.api.common.operators.util.FieldSet)111 Test (org.junit.Test)97 SingleInputSemanticProperties (org.apache.flink.api.common.operators.SingleInputSemanticProperties)57 Plan (org.apache.flink.api.common.Plan)37 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)37 GlobalProperties (org.apache.flink.optimizer.dataproperties.GlobalProperties)28 LocalProperties (org.apache.flink.optimizer.dataproperties.LocalProperties)28 SourcePlanNode (org.apache.flink.optimizer.plan.SourcePlanNode)27 OptimizedPlan (org.apache.flink.optimizer.plan.OptimizedPlan)25 Tuple3 (org.apache.flink.api.java.tuple.Tuple3)24 SinkPlanNode (org.apache.flink.optimizer.plan.SinkPlanNode)24 FieldList (org.apache.flink.api.common.operators.util.FieldList)14 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)14 MapOperatorBase (org.apache.flink.api.common.operators.base.MapOperatorBase)13 DualInputSemanticProperties (org.apache.flink.api.common.operators.DualInputSemanticProperties)9 Ordering (org.apache.flink.api.common.operators.Ordering)9 SemanticProperties (org.apache.flink.api.common.operators.SemanticProperties)5 Channel (org.apache.flink.optimizer.plan.Channel)4 SingleInputPlanNode (org.apache.flink.optimizer.plan.SingleInputPlanNode)4 Configuration (org.apache.flink.configuration.Configuration)3