Re: DynamicTableSink's equivalent of UpsertStreamTableSink.setKeyFields

2021-02-04 Thread Timo Walther
For this you might need to go a level deeper. Maybe the legacy util org.apache.flink.table.planner.plan.utils.UpdatingPlanChecker can help you. It analyzes the plan to figure out the keys. org.apache.flink.table.planner.plan.metadata.FlinkRelMdUniqueKeys seems the newer version. Regards, Ti

Re: DynamicTableSink's equivalent of UpsertStreamTableSink.setKeyFields

2021-02-03 Thread Yuval Itzchakov
Hi Timo, The problem with this is I would still have to determine the keys manually, which is not really feasible in my case. Is there any internal API that might be of use to extract this information? On Wed, Feb 3, 2021 at 5:19 PM Timo Walther wrote: > Hi Yuval, > > we changed this behavior a

Re: DynamicTableSink's equivalent of UpsertStreamTableSink.setKeyFields

2021-02-03 Thread Timo Walther
Hi Yuval, we changed this behavior a bit to be more SQL compliant. Currently, sinks must be explicitly defined with a PRIMARY KEY constraint. We had discussions about implicit sinks, but nothing on the roadmap yet. The `CREATE TEMPORARY TABLE LIKE` clause should make it easy to extend the ori

DynamicTableSink's equivalent of UpsertStreamTableSink.setKeyFields

2021-02-03 Thread Yuval Itzchakov
Hi, I'm reworking an existing UpsertStreamTableSink into the new DynamicTableSink API. In the previous API, one would get the unique keys for upsert queries via the `setKeyFields` method, which would calculate them based on the grouping keys during the translation phase. Searching around, I saw th