You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by da...@apache.org on 2025/02/04 01:11:16 UTC

(hudi) branch master updated: [HUDI-8278] Add log message about different primary keys for HoodieTableFactory (#12766)

This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c4c2b20934 [HUDI-8278] Add log message about different primary keys for HoodieTableFactory (#12766)
4c4c2b20934 is described below

commit 4c4c2b209349470f1f57d304a92ee93dddc01134
Author: Ekaterina Belousova <gr...@gmail.com>
AuthorDate: Tue Feb 4 08:11:09 2025 +0700

    [HUDI-8278] Add log message about different primary keys for HoodieTableFactory (#12766)
---
 .../src/main/java/org/apache/hudi/table/HoodieTableFactory.java        | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java
index f7f9506050d..6236fe63789 100644
--- a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java
+++ b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java
@@ -229,6 +229,9 @@ public class HoodieTableFactory implements DynamicTableSourceFactory, DynamicTab
                 + "'" + FlinkOptions.RECORD_KEY_FIELD.key() + "' does not exist in the table schema.");
           });
     }
+    if (schema.getPrimaryKey().isPresent() && conf.containsKey(FlinkOptions.RECORD_KEY_FIELD.key()))   {
+      LOG.warn("PRIMARY KEY syntax and option '" + FlinkOptions.RECORD_KEY_FIELD.key() + "' was used. Priority of the PRIMARY KEY is higher!");
+    }
   }
 
   /**