Search in sources :

Example 1 with RankProcessStrategy

use of org.apache.flink.table.planner.plan.utils.RankProcessStrategy in project flink by apache.

the class RankProcessStrategySerdeTest method testRankRange.

@Test
public void testRankRange() throws JsonProcessingException {
    ObjectMapper mapper = new ObjectMapper();
    RankProcessStrategy[] strategies = new RankProcessStrategy[] { RankProcessStrategy.UNDEFINED_STRATEGY, RankProcessStrategy.APPEND_FAST_STRATEGY, RankProcessStrategy.RETRACT_STRATEGY, new RankProcessStrategy.UpdateFastStrategy(new int[] { 1, 2 }) };
    for (RankProcessStrategy strategy : strategies) {
        RankProcessStrategy result = mapper.readValue(mapper.writeValueAsString(strategy), RankProcessStrategy.class);
        assertEquals(strategy.toString(), result.toString());
    }
}
Also used : RankProcessStrategy(org.apache.flink.table.planner.plan.utils.RankProcessStrategy) ObjectMapper(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

ObjectMapper (org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper)1 RankProcessStrategy (org.apache.flink.table.planner.plan.utils.RankProcessStrategy)1 Test (org.junit.Test)1