Maxwell-Guo commented on code in PR #4316:
URL: https://github.com/apache/cassandra/pull/4316#discussion_r2278177117


##########
src/java/org/apache/cassandra/db/virtual/SettingsTable.java:
##########
@@ -93,8 +95,17 @@ String getValue(Property prop)
         if (value == null)
             return null;
 
-        if (value.getClass().isArray())
-            return Arrays.asList((Object[]) value).toString();
+        if (value.getClass().isArray() || value instanceof Collection || value 
instanceof Map)
+        {
+            try {

Review Comment:
   
   ```
   if (value.getClass.isArray())
     return Arrays.asList((Object[]) value).toString();
   if (value instanceof Collection || value instanceof Map)
     xxxx
   ```
   



##########
test/unit/org/apache/cassandra/db/virtual/SettingsTableTest.java:
##########
@@ -71,7 +71,7 @@ public void config()
     public void testArray() throws Throwable
     {

Review Comment:
   I think we should add more test case here , the value type can be map, 
set,list , for example : 
     ```
   config.seed_provider =  new ParameterizedClass();
           config.seed_provider.class_name = 
"org.apache.cassandra.locator.SimpleSeedProvider";
           config.seed_provider.parameters = Map.of("seeds", "127.0.0.1:7000");
   ```
   and 
   `SELECT * FROM vts.settings`
   to see if the map value can be convert to json.
   



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to