danny0405 commented on code in PR #6396:
URL: https://github.com/apache/hudi/pull/6396#discussion_r946273670


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -207,10 +208,23 @@ private static void setupHoodieKeyOptions(Configuration 
conf, CatalogTable table
       conf.setString(FlinkOptions.PARTITION_PATH_FIELD, String.join(",", 
partitionKeys));
     }
     // set index key for bucket index if not defined
-    if 
(conf.getString(FlinkOptions.INDEX_TYPE).equals(HoodieIndex.IndexType.BUCKET.name())
-        && conf.getString(FlinkOptions.INDEX_KEY_FIELD).isEmpty()) {
-      conf.setString(FlinkOptions.INDEX_KEY_FIELD, 
conf.getString(FlinkOptions.RECORD_KEY_FIELD));
+    if 
(conf.getString(FlinkOptions.INDEX_TYPE).equals(HoodieIndex.IndexType.BUCKET.name()))
 {
+      if (conf.getString(FlinkOptions.INDEX_KEY_FIELD).isEmpty()) {
+        conf.setString(FlinkOptions.INDEX_KEY_FIELD, 
conf.getString(FlinkOptions.RECORD_KEY_FIELD));
+      } else {
+        HashSet<String> recordKeySet = new HashSet<>(Arrays.asList(
+            conf.getString(FlinkOptions.RECORD_KEY_FIELD).split(",")
+        ));

Review Comment:
   
`Arrays.stream(conf.getString(FlinkOptions.RECORD_KEY_FIELD).split(",")).collect(Collectors.toSet())`
 should also work.



-- 
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]

Reply via email to