[
https://issues.apache.org/jira/browse/FLINK-24116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17408565#comment-17408565
]
Ingo Bürk commented on FLINK-24116:
-----------------------------------
If we actually want to disallow defining a primary key at all on insert-only
sources (rather than preventing it only when used in a temporal join or
wherever it causes problems), we should make sure that the error message is
specific enough to explain why it cannot be defined, as people coming from
traditional SQL are probably used to just defining PK on data when it makes
sense (I sure would be stumped if a system told me that I'm just not allowed to
define a PK on a table).
However, I kind of feel like we should prevent it being used incorrectly, not
being defined at all. Otherwise this has implications for catalog
implementations which need to know the changelog mode of a table to know
whether they should set the primary key.
> PRIMARY KEY declaration on insert-only table is not validated globally
> ----------------------------------------------------------------------
>
> Key: FLINK-24116
> URL: https://issues.apache.org/jira/browse/FLINK-24116
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Reporter: Timo Walther
> Priority: Major
>
> In the regular Kafka connector, we validate that a primary key is not defined
> on an insert-only table source:
> https://github.com/apache/flink/pull/13850/commits/c1d4dc89fa629e0f04102e7ab2fa94984cd98218
> However, this should be validated for every connector because it is confusing
> if it works for others. We should validate this in the planner instead.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)