geserdugarov commented on code in PR #17994:
URL: https://github.com/apache/hudi/pull/17994#discussion_r2726846523
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/configuration/OptionsResolver.java:
##########
@@ -151,13 +152,28 @@ public static boolean
isDefaultHoodieRecordPayloadClazz(Configuration conf) {
return
conf.get(FlinkOptions.PAYLOAD_CLASS_NAME).contains(DefaultHoodieRecordPayload.class.getSimpleName());
}
+ /**
+ * Return value of {@link FlinkOptions#RECORD_KEY_FIELD} if it was set,
+ * or throw exception otherwise.
+ */
+ public static String getRecordKeyStrOrFail(Configuration conf) {
+ final String recordKeyStr = conf.get(FlinkOptions.RECORD_KEY_FIELD);
+ if (null == recordKeyStr) {
Review Comment:
I'm concerned that the logic for obtaining the record key is used in many
places besides `HoodieTableFactory`, so it can't be moved in that class:
<img width="2486" height="1252" alt="image"
src="https://github.com/user-attachments/assets/c7b67ce9-c74c-407a-be58-d19d4f90ae46"
/>
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]