[ 
https://issues.apache.org/jira/browse/FLINK-15407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17004019#comment-17004019
 ] 

Jark Wu commented on FLINK-15407:
---------------------------------

Adding some notes about this on docs is good. But I'm worried it doesn't help 
too much. Because the note is not obvious to users and it is easy to lose 
primary key in use cases. I'm wondering whether we should come up with a better 
solution for this, for example relax the limitation as it doesn't fail in 
traditional databases, right? 

We have some other discussion about this in FLINK-14567.

> 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
>            Priority: Major
>             Fix For: 1.10.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)

Reply via email to