rdblue commented on a change in pull request #2465:
URL: https://github.com/apache/iceberg/pull/2465#discussion_r615310999



##########
File path: api/src/main/java/org/apache/iceberg/Schema.java
##########
@@ -355,9 +397,15 @@ private Schema internalSelect(Collection<String> names, 
boolean caseSensitive) {
 
   @Override
   public String toString() {
-    return String.format("table {\n%s\n}",
-        NEWLINE.join(struct.fields().stream()
-            .map(f -> "  " + f)
-            .collect(Collectors.toList())));
+    StringBuilder sb = new StringBuilder();
+    sb.append("table {\n");
+    sb.append("  fields {\n");
+    sb.append(NEWLINE.join(struct.fields().stream()
+        .map(f -> "    " + f)
+        .collect(Collectors.toList())));
+    sb.append("\n  }\n  identifier fields { ");
+    sb.append(COMMA.join(identifierFieldIds()));
+    sb.append(" }\n}");
+    return sb.toString();

Review comment:
       Minor: I'd prefer a smaller change to the `toString` format. Maybe 
something like adding `(id)` to identifier fields in the list, rather than 
adding the `identifier fields { ... }`.




-- 
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:
[email protected]



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

Reply via email to