This is an automated email from the ASF dual-hosted git repository.
diwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-flink-connector.git
The following commit(s) were added to refs/heads/master by this push:
new 4ed08f4 [improve](cdc) support synchronization of PostgreSQL
partitioned tables (#389)
4ed08f4 is described below
commit 4ed08f4f00fcdc9465aa0ca8516866ebc67045b5
Author: Petrichor <[email protected]>
AuthorDate: Thu May 23 13:59:23 2024 +0800
[improve](cdc) support synchronization of PostgreSQL partitioned tables
(#389)
---
.../doris/flink/tools/cdc/postgres/PostgresDatabaseSync.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/postgres/PostgresDatabaseSync.java
b/flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/postgres/PostgresDatabaseSync.java
index 490fdbc..c9387c1 100644
---
a/flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/postgres/PostgresDatabaseSync.java
+++
b/flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/postgres/PostgresDatabaseSync.java
@@ -104,7 +104,11 @@ public class PostgresDatabaseSync extends DatabaseSync {
try (Connection conn = getConnection()) {
DatabaseMetaData metaData = conn.getMetaData();
try (ResultSet tables =
- metaData.getTables(databaseName, schemaName, "%", new
String[] {"TABLE"})) {
+ metaData.getTables(
+ databaseName,
+ schemaName,
+ "%",
+ new String[] {"TABLE", "PARTITIONED TABLE"})) {
while (tables.next()) {
String tableName = tables.getString("TABLE_NAME");
String tableComment = tables.getString("REMARKS");
@@ -115,7 +119,7 @@ public class PostgresDatabaseSync extends DatabaseSync {
new PostgresSchema(
metaData, databaseName, schemaName,
tableName, tableComment);
sourceSchema.setModel(
- sourceSchema.primaryKeys.size() > 0
+ !sourceSchema.primaryKeys.isEmpty()
? DataModel.UNIQUE
: DataModel.DUPLICATE);
schemaList.add(sourceSchema);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]