Search in sources :

Example 1 with VariableRankRange

use of org.apache.flink.table.runtime.operators.rank.VariableRankRange in project flink by apache.

the class RankRangeSerdeTest method testRankRange.

@Test
public void testRankRange() throws JsonProcessingException {
    ObjectMapper mapper = new ObjectMapper();
    RankRange[] ranges = new RankRange[] { new ConstantRankRange(1, 2), new VariableRankRange(3), new ConstantRankRangeWithoutEnd(4) };
    for (RankRange range : ranges) {
        RankRange result = mapper.readValue(mapper.writeValueAsString(range), RankRange.class);
        assertEquals(range.toString(), result.toString());
    }
}
Also used : RankRange(org.apache.flink.table.runtime.operators.rank.RankRange) ConstantRankRange(org.apache.flink.table.runtime.operators.rank.ConstantRankRange) VariableRankRange(org.apache.flink.table.runtime.operators.rank.VariableRankRange) ConstantRankRangeWithoutEnd(org.apache.flink.table.runtime.operators.rank.ConstantRankRangeWithoutEnd) VariableRankRange(org.apache.flink.table.runtime.operators.rank.VariableRankRange) ConstantRankRange(org.apache.flink.table.runtime.operators.rank.ConstantRankRange) 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 ConstantRankRange (org.apache.flink.table.runtime.operators.rank.ConstantRankRange)1 ConstantRankRangeWithoutEnd (org.apache.flink.table.runtime.operators.rank.ConstantRankRangeWithoutEnd)1 RankRange (org.apache.flink.table.runtime.operators.rank.RankRange)1 VariableRankRange (org.apache.flink.table.runtime.operators.rank.VariableRankRange)1 Test (org.junit.Test)1