You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/05/11 18:08:28 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6900: TableConfigs toJsonObject fix

Jackie-Jiang commented on a change in pull request #6900:
URL: https://github.com/apache/incubator-pinot/pull/6900#discussion_r630412433



##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/config/TableConfigs.java
##########
@@ -70,6 +71,24 @@ public TableConfig getRealtime() {
     return _realtime;
   }
 
+  @Override
+  public String toJsonString() {
+    try {
+      ObjectNode tableConfigs = JsonUtils.newObjectNode();
+      tableConfigs.put("tableName", _tableName);
+      tableConfigs.set("schema", _schema.toJsonObject());
+      if (_offline != null) {
+        tableConfigs.set("offline", _offline.toJsonNode());
+      }
+      if (_realtime != null) {
+        tableConfigs.set("realtime", _realtime.toJsonNode());
+      }
+      return JsonUtils.objectToString(tableConfigs);
+    } catch (JsonProcessingException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
   public String toPrettyJsonString() {

Review comment:
       Should we also modify this method? We can add a helper method `toJsonObject()` and both of them can use that




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org