You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/30 19:45:10 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5275: Write metadata-location instead of metadataLocation

rdblue commented on code in PR #5275:
URL: https://github.com/apache/iceberg/pull/5275#discussion_r933881451


##########
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java:
##########
@@ -37,6 +42,56 @@
  */
 public class LoadTableResponse implements RESTResponse {
 
+  private static final String METADATA_LOCATION = "metadata-location";
+  private static final String METADATA = "metadata";
+  private static final String CONFIG = "config";
+
+  public static void toJson(LoadTableResponse loadTable, JsonGenerator generator) throws IOException {
+    generator.writeStartObject();
+
+    generator.writeStringField(METADATA_LOCATION, loadTable.metadataLocation);
+
+    generator.writeFieldName(METADATA);
+    TableMetadataParser.toJson(loadTable.metadata, generator);
+
+    generator.writeObjectFieldStart(CONFIG);
+    for (Map.Entry<String, String> keyValue : loadTable.config.entrySet()) {
+      generator.writeStringField(keyValue.getKey(), keyValue.getValue());

Review Comment:
   I don't think there should be any null values.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org