You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Xianxun Ye (Jira)" <ji...@apache.org> on 2021/08/12 11:36:00 UTC

[jira] [Created] (FLINK-23739) PrintTableSink do not implement SupportsPartitioning interface

Xianxun Ye created FLINK-23739:
----------------------------------

             Summary: PrintTableSink do not implement SupportsPartitioning interface
                 Key: FLINK-23739
                 URL: https://issues.apache.org/jira/browse/FLINK-23739
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / API
    Affects Versions: 1.12.4
            Reporter: Xianxun Ye


 
{code:java}
//代码占位符
tEnv.executeSql(
        "CREATE TABLE PrintTable (name STRING, score INT, da STRING, hr STRING)\n"
                + "PARTITIONED BY (da, hr)"
                + "WITH (\n"
                + "  'connector' = 'print'"
                + ")");

tEnv.executeSql("INSERT INTO PrintTable SELECT 'n1' as name, 1 as score, '2021-08-12' as da, '11' as hr");

{code}
Now print records with a partitioned table is not supported.
{code:java}
//代码占位符
Exception in thread "main" org.apache.flink.table.api.TableException: Table 'default_catalog.default_database.PrintTable' is a partitioned table, but the underlying DynamicTableSink doesn't implement the SupportsPartitioning interface.Exception in thread "main" org.apache.flink.table.api.TableException: Table 'default_catalog.default_database.PrintTable' is a partitioned table, but the underlying DynamicTableSink doesn't implement the SupportsPartitioning interface. at org.apache.flink.table.planner.sinks.DynamicSinkUtils.validatePartitioning(DynamicSinkUtils.java:345) at org.apache.flink.table.planner.sinks.DynamicSinkUtils.prepareDynamicSink(DynamicSinkUtils.java:260) at org.apache.flink.table.planner.sinks.DynamicSinkUtils.toRel(DynamicSinkUtils.java:87)
{code}
`org.apache.flink.table.factories.PrintTableSinkFactory$PrintSink` and `org.apache.flink.table.factories.BlackHoleTableSinkFactory$BlackHoleSink` shoud implement `SupportsPartitioning` interface. 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)