[
https://issues.apache.org/jira/browse/FLINK-24050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17427477#comment-17427477
]
Ingo Bürk commented on FLINK-24050:
-----------------------------------
No, I'm not planning on working on this for the time being. It's probably quite
a bit of work since the PK is taken from the physical schema in quite a few
places, I think.
> Support primary keys on metadata columns
> ----------------------------------------
>
> Key: FLINK-24050
> URL: https://issues.apache.org/jira/browse/FLINK-24050
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Ingo Bürk
> Priority: Major
>
> Currently, primary keys are required to consist solely of physical columns.
> However, there might be scenarios where the actual payload/records do not
> contain a suitable primary key, but a unique identifier is available through
> metadata. In this case it would make sense to define the primary key on such
> a metadata column:
> {code:java}
> CREATE TABLE T (
> uid STRING METADATA,
> content STRING
> PRIMARY KEY (uid) NOT ENFORCED
> ) WITH (…)
> {code}
> A simple example for this would be IMAP: there is nothing unique about any
> single email as a record, but each email in a specific folder on an IMAP
> server has a unique UID (I'm excluding some irrelevant technical details
> here).
> See FLINK-24512 for another (probably better) use case.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)