Jackie-Jiang commented on a change in pull request #3694: Fix the TableConfig 
toJSONConfig() method
URL: https://github.com/apache/incubator-pinot/pull/3694#discussion_r248124280
 
 

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/common/config/TableConfig.java
 ##########
 @@ -158,22 +158,22 @@ public static TableConfig fromJSONConfig(@Nonnull 
JsonNode jsonConfig) throws IO
   }
 
   @Nonnull
-  public static JsonNode toJSONConfig(@Nonnull TableConfig tableConfig) throws 
JsonProcessingException {
+  public static JsonNode toJSONConfig(@Nonnull TableConfig tableConfig) {
     ObjectNode jsonConfig = JsonUtils.newObjectNode();
     jsonConfig.put(TABLE_NAME_KEY, tableConfig._tableName);
     jsonConfig.put(TABLE_TYPE_KEY, tableConfig._tableType.toString());
-    jsonConfig.put(VALIDATION_CONFIG_KEY, 
JsonUtils.objectToString(tableConfig._validationConfig));
-    jsonConfig.put(TENANT_CONFIG_KEY, 
JsonUtils.objectToString(tableConfig._tenantConfig));
-    jsonConfig.put(INDEXING_CONFIG_KEY, 
JsonUtils.objectToString(tableConfig._indexingConfig));
-    jsonConfig.put(CUSTOM_CONFIG_KEY, 
JsonUtils.objectToString(tableConfig._customConfig));
+    jsonConfig.set(VALIDATION_CONFIG_KEY, 
JsonUtils.objectToJsonNode(tableConfig._validationConfig));
+    jsonConfig.set(TENANT_CONFIG_KEY, 
JsonUtils.objectToJsonNode(tableConfig._tenantConfig));
+    jsonConfig.set(INDEXING_CONFIG_KEY, 
JsonUtils.objectToJsonNode(tableConfig._indexingConfig));
+    jsonConfig.set(CUSTOM_CONFIG_KEY, 
JsonUtils.objectToJsonNode(tableConfig._customConfig));
     if (tableConfig._quotaConfig != null) {
 
 Review comment:
   Empty validation config and indexing config does not make sense. The default 
constructor is not used except for testing cases, and we should always use the 
builder mode. I don't want to remove the default constructor for now because I 
don't know if the new config depends on that. BTW, I think this is out of the 
scope of this PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to