Search in sources :

Example 1 with NullableCoder

use of org.apache.beam.sdk.coders.NullableCoder in project beam by apache.

the class LatestTest method testGloballyOutputCoder.

@Test
public void testGloballyOutputCoder() {
    p.enableAbandonedNodeEnforcement(false);
    BigEndianLongCoder inputCoder = BigEndianLongCoder.of();
    PCollection<Long> output = p.apply(Create.of(1L, 2L).withCoder(inputCoder)).apply(Latest.globally());
    Coder<Long> outputCoder = output.getCoder();
    assertThat(outputCoder, instanceOf(NullableCoder.class));
    assertEquals(inputCoder, ((NullableCoder<?>) outputCoder).getValueCoder());
}
Also used : NullableCoder(org.apache.beam.sdk.coders.NullableCoder) BigEndianLongCoder(org.apache.beam.sdk.coders.BigEndianLongCoder) Test(org.junit.Test)

Aggregations

BigEndianLongCoder (org.apache.beam.sdk.coders.BigEndianLongCoder)1 NullableCoder (org.apache.beam.sdk.coders.NullableCoder)1 Test (org.junit.Test)1