LiJie20190102 commented on code in PR #9334:
URL: https://github.com/apache/inlong/pull/9334#discussion_r1405567037


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/HudiExtractNode.java:
##########
@@ -142,15 +143,17 @@ public Map<String, String> tableOptions() {
 
         // If the extend attributes starts with .ddl,
         // it will be passed to the ddl statement of the table
-        extList.forEach(ext -> {
-            String keyName = ext.get(EXTEND_ATTR_KEY_NAME);
-            if (StringUtils.isNoneBlank(keyName) &&
-                    keyName.startsWith(DDL_ATTR_PREFIX)) {
-                String ddlKeyName = 
keyName.substring(DDL_ATTR_PREFIX.length());
-                String ddlValue = ext.get(EXTEND_ATTR_VALUE_NAME);
-                options.put(ddlKeyName, ddlValue);
-            }
-        });
+        if (CollectionUtils.isNotEmpty(extList)) {

Review Comment:
   I also think the same way. Initially, I prohibited 'primaryKey' from being 
empty, but I saw that there was already a 'PR' (#9323) solution to avoid 
setting 'primaryKey', so I changed it back. At the same time, the official 
website did not say that this configuration is mandatory. Finally, I believe it 
should not be empty, as normal use requires the use of primary keys. What do 
others think? 



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/HudiExtractNode.java:
##########
@@ -142,15 +143,17 @@ public Map<String, String> tableOptions() {
 
         // If the extend attributes starts with .ddl,
         // it will be passed to the ddl statement of the table
-        extList.forEach(ext -> {
-            String keyName = ext.get(EXTEND_ATTR_KEY_NAME);
-            if (StringUtils.isNoneBlank(keyName) &&
-                    keyName.startsWith(DDL_ATTR_PREFIX)) {
-                String ddlKeyName = 
keyName.substring(DDL_ATTR_PREFIX.length());
-                String ddlValue = ext.get(EXTEND_ATTR_VALUE_NAME);
-                options.put(ddlKeyName, ddlValue);
-            }
-        });
+        if (CollectionUtils.isNotEmpty(extList)) {

Review Comment:
   I also think the same way. Initially, I prohibited 'primaryKey' from being 
empty, but I saw that there was already a 'PR' (#9323) solution to avoid 
setting 'primaryKey', so I changed it back. At the same time, the official 
website did not say that this configuration is mandatory. Finally, I believe it 
should not be empty, as normal use requires the use of primary keys. What do 
others think? 



-- 
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: commits-unsubscr...@inlong.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to