Abyss-lord commented on code in PR #8512:
URL: https://github.com/apache/gravitino/pull/8512#discussion_r2338357808


##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/jdbc/GravitinoJdbcCatalog.java:
##########
@@ -85,7 +85,7 @@ protected SparkTypeConverter getSparkTypeConverter() {
   public void createNamespace(String[] namespace, Map<String, String> metadata)
       throws NamespaceAlreadyExistsException {
     Map<String, String> properties = Maps.newHashMap();
-    if (!metadata.isEmpty()) {
+    if (metadata != null && !metadata.isEmpty()) {

Review Comment:
   we can simplify this using a utility method:
   ```java
   if (MapUtils.isNotEmpty(metadata)) {
       ...
   }
   ```
   Benefits:
   
   1. **Readability** – isNotEmpty makes the intent clearer at a glance.
   2. **Safety** – it handles the null check internally, so we don’t need an 
explicit `!= null`.
   3. **Consistency** – aligns with common practice of using utility classes 
rather than repeating the null/empty check pattern.
   



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