wuchong commented on a change in pull request #10213:
[FLINK-12846][table-common] Carry primary key information in TableSchema
URL: https://github.com/apache/flink/pull/10213#discussion_r347136213
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
##########
@@ -246,7 +287,28 @@ public DataType toRowDataType() {
* support multiple watermarks definition yet. But in the future, we
may support multiple watermarks.
*/
public List<WatermarkSpec> getWatermarkSpecs() {
- return watermarkSpecs;
+ return new ArrayList<>(watermarkSpecs);
+ }
+
+ /**
+ * Returns primary key defined on the table. A primary key is consist
of single or
+ * multiple field names. The returned list will be empty if no primary
key is defined.
+ *
+ * <p>See the {@link TableSchema} class javadoc for more definition
about primary key.
+ */
+ public List<String> getPrimaryKey() {
Review comment:
I think having a dedicated `PrimaryKey` class is a good idea.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services