This is an automated email from the ASF dual-hosted git repository. yihua 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 e2adc502a2a [HUDI-6190] Adjust description in the HoodieTableFactory.checkRecordKey exception (#8688) e2adc502a2a is described below commit e2adc502a2ad01e95e89ca940f8902988572db25 Author: Stan <53285109+houhang1...@users.noreply.github.com> AuthorDate: Wed May 24 05:09:07 2023 +0800 [HUDI-6190] Adjust description in the HoodieTableFactory.checkRecordKey exception (#8688) When set 'uuid' is recordkey field and the table schema doesn't contain this column, the user would be notified that "did not modify the recordkey". This commit appends the description to let Hudi beginner check whether the default recordkey is in the schema. --- .../src/main/java/org/apache/hudi/table/HoodieTableFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 58413926e51..5694df0dfd8 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 @@ -196,8 +196,9 @@ public class HoodieTableFactory implements DynamicTableSourceFactory, DynamicTab if (recordKeys.length == 1 && FlinkOptions.RECORD_KEY_FIELD.defaultValue().equals(recordKeys[0]) && !fields.contains(recordKeys[0])) { - throw new HoodieValidationException("Primary key definition is required, use either PRIMARY KEY syntax " - + "or option '" + FlinkOptions.RECORD_KEY_FIELD.key() + "' to specify."); + throw new HoodieValidationException("Primary key definition is required, the default primary key field " + + "'" + FlinkOptions.RECORD_KEY_FIELD.defaultValue() + "' does not exist in the table schema, " + + "use either PRIMARY KEY syntax or option '" + FlinkOptions.RECORD_KEY_FIELD.key() + "' to speciy."); } Arrays.stream(recordKeys)