You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yaroslav Tkachenko (Jira)" <ji...@apache.org> on 2022/06/01 17:53:00 UTC
[jira] [Created] (FLINK-27873) Primary key is lost after calling addColumns
Yaroslav Tkachenko created FLINK-27873:
------------------------------------------
Summary: Primary key is lost after calling addColumns
Key: FLINK-27873
URL: https://issues.apache.org/jira/browse/FLINK-27873
Project: Flink
Issue Type: Bug
Components: Table SQL / Runtime
Affects Versions: 1.14.4
Reporter: Yaroslav Tkachenko
I've noticed that when adding new columns via *addColumns* method in the Table API the information about the primary key is lost.
I was able to track it down to the following files:
* [ProjectionOperationFactory.create|https://github.com/apache/flink/blob/fbc086f2fd63dac4af3e104ba4011e864781139a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/utils/ProjectionOperationFactory.java#L91-L92] creates a new QueryOperation for the updated table and it calls *ResolvedSchema.physical* method in the end.
* [ResolvedSchema.physical|https://github.com/apache/flink/blob/94328f90c5a3d13acff6dfbf2e22d1c7aa59c080/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ResolvedSchema.java#L97] method always creates ResolvedSchema with null as a primary key.
This is not a behaviour I'd expect when _adding_ new columns.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)