You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2023/09/13 08:41:58 UTC
[incubator-paimon] branch master updated: [flink] The table's primary key use a fixed constraint name. (#1997)
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 490f0fa36 [flink] The table's primary key use a fixed constraint name. (#1997)
490f0fa36 is described below
commit 490f0fa36681208d569fa729731f6a91e2990f9a
Author: sai <57...@users.noreply.github.com>
AuthorDate: Wed Sep 13 16:41:46 2023 +0800
[flink] The table's primary key use a fixed constraint name. (#1997)
---
.../src/main/java/org/apache/paimon/flink/FlinkCatalog.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java
index 3aed103eb..406969ea5 100644
--- a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java
+++ b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java
@@ -604,7 +604,9 @@ public class FlinkCatalog extends AbstractCatalog {
// add primary keys
if (table.primaryKeys().size() > 0) {
- builder.primaryKey(table.primaryKeys().toArray(new String[0]));
+ builder.primaryKey(
+ table.primaryKeys().stream().collect(Collectors.joining("_", "PK_", "")),
+ table.primaryKeys().toArray(new String[0]));
}
TableSchema schema = builder.build();