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` would be `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.
##########
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)` would be `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.
--
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]