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


##########
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:
   1、the extList should add a check for npe, well done 
   2、as for primary key, 
   
![image](https://github.com/apache/inlong/assets/26538404/1aed485f-b0d0-40e5-ab11-44cf962277c3)
    In hudi connector , the npe throws because we set string "null" for primary 
key but this "null" is not contained in hudi schema; that's the situation this 
pr #9323 trying to solve 
   Actually hudi can run without setting a specific pk (in this case hudi will 
generate a primary key itself) so in hudi official code, the 
hoodie.datasource.write.recordkey.field is optional;



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