You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jingsong Lee (Jira)" <ji...@apache.org> on 2020/01/10 03:32:00 UTC

[jira] [Updated] (FLINK-15407) Add document to explain how to write a table with PK

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

Jingsong Lee updated FLINK-15407:
---------------------------------
    Fix Version/s:     (was: 1.10.0)
                   1.11.0

> Add document to explain how to write a table with PK
> ----------------------------------------------------
>
>                 Key: FLINK-15407
>                 URL: https://issues.apache.org/jira/browse/FLINK-15407
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation, Table SQL / API
>            Reporter: Jingsong Lee
>            Assignee: Jingsong Lee
>            Priority: Major
>             Fix For: 1.11.0
>
>
> I have had several user problems:
> Why is an error reported when writing the upsertsink: TableException: UpsertStreamTableSink requires that Table has a full primary keys if it is updated.
> Users are confused.
> I think we can consider writing a document to describe it.
> User need careful like:
>  
> {code:java}
> insert into result_table select pk1, if(pk2 is null, '', pk2) as pk2, count(*), sum(f3) from source group by pk1, pk2; {code}
> This will failed.
>  
> {code:java}
> insert into result_table select pk1, pk2, count(*), sum(f1) from (select pk1, if(pk2 is null, '', pk2) as pk2, f1 from source) group by pk1, pk2; 
> {code}
> This can work.



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