You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/12/11 09:38:00 UTC

[jira] [Closed] (FLINK-20535) "GROUPING SETS" query result cannot upsert to table

     [ https://issues.apache.org/jira/browse/FLINK-20535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu closed FLINK-20535.
---------------------------
    Resolution: Not A Problem

The legacy sink (by using 'connector.type' = 'xxx') infers primary key from query, however, primary key can't be inferred in many cases. 

This problem has been fixed in 1.11 by introducing the new sink (by using 'connector' = 'xxx'), it will always use the primary key defined on the DDL. 

You can have a look at the docs: https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/connectors/jdbc.html

> "GROUPING SETS" query  result cannot upsert to table
> ----------------------------------------------------
>
>                 Key: FLINK-20535
>                 URL: https://issues.apache.org/jira/browse/FLINK-20535
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.11.2
>            Reporter: richt richt
>            Priority: Major
>
>  
> {code:java}
> //代码占位符
> insert into table_sink
> city , case when dt is null then 'ALL' else dt end,
> count(*) from table_source
> group by GROUPING SETS ((city, dt), dt)
> {code}
> even i spicify the primary key in the table_sink , but it still  throw exeception 
> "UpsertStreamTableSink requires that Table has a full primary keys if it is updated."
> at org.apache.flink.table.planner.plan.nodes.physical.stream.StreamExecLegacySink.translateToPlanInternal(StreamExecLegacySink.scala:93)



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