Search in sources :

Example 1 with SupportsPartitioning

use of org.apache.flink.table.connector.sink.abilities.SupportsPartitioning in project flink by apache.

the class BlackHoleSinkFactoryTest method testBlackHole.

@Test
public void testBlackHole() {
    Map<String, String> properties = new HashMap<>();
    properties.put("connector", "blackhole");
    List<String> partitionKeys = Arrays.asList("f0", "f1");
    DynamicTableSink sink = createTableSink(SCHEMA, partitionKeys, properties);
    assertEquals("BlackHole", sink.asSummaryString());
    assertTrue(sink instanceof SupportsPartitioning);
}
Also used : SupportsPartitioning(org.apache.flink.table.connector.sink.abilities.SupportsPartitioning) HashMap(java.util.HashMap) DynamicTableSink(org.apache.flink.table.connector.sink.DynamicTableSink) Test(org.junit.Test)

Example 2 with SupportsPartitioning

use of org.apache.flink.table.connector.sink.abilities.SupportsPartitioning in project flink by apache.

the class PrintSinkFactoryTest method testPrint.

@Test
public void testPrint() {
    Map<String, String> properties = new HashMap<>();
    properties.put("connector", "print");
    properties.put(PrintConnectorOptions.PRINT_IDENTIFIER.key(), "my_print");
    properties.put(PrintConnectorOptions.STANDARD_ERROR.key(), "true");
    List<String> partitionKeys = Arrays.asList("f0", "f1");
    DynamicTableSink sink = createTableSink(SCHEMA, partitionKeys, properties);
    Assert.assertEquals("Print to System.err", sink.asSummaryString());
    Assert.assertTrue(sink instanceof SupportsPartitioning);
}
Also used : SupportsPartitioning(org.apache.flink.table.connector.sink.abilities.SupportsPartitioning) HashMap(java.util.HashMap) DynamicTableSink(org.apache.flink.table.connector.sink.DynamicTableSink) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)2 DynamicTableSink (org.apache.flink.table.connector.sink.DynamicTableSink)2 SupportsPartitioning (org.apache.flink.table.connector.sink.abilities.SupportsPartitioning)2 Test (org.junit.Test)2