itsaviu commented on code in PR #5125:
URL: https://github.com/apache/gravitino/pull/5125#discussion_r1798787186


##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java:
##########
@@ -170,13 +170,12 @@ protected String generateCreateTableSql(
   }
 
   private Map<String, String> appendNecessaryProperties(Map<String, String> 
properties) {
-    Map<String, String> resultMap;
     if (properties == null) {
-      resultMap = new HashMap<>();
-    } else {
-      resultMap = new HashMap<>(properties);
+      return new HashMap<>();
     }
 
+    Map<String, String> resultMap = new HashMap<>(properties);

Review Comment:
   @yuqi1129  My thoughts was, the problem in L184 
`!properties.containsKey(REPLICATION_FACTOR)` where `properties` can be null 
and NPE could occur, so in L173 `properties == null` we check if it is NULL and 
return a empty Map right way. 
   
   But agree by cloning the `properties` to `resultMap` but checking the 
condition with `properties` and can miss to add the `REPLICATION_FACTOR`, 
thinking to have a minimal change.
   
   I will make the change to check `resultMap`



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