paul-rogers commented on a change in pull request #1599: DRILL-6903: 
SchemaBuilder code improvements
URL: https://github.com/apache/drill/pull/1599#discussion_r245888611
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/TupleSchema.java
 ##########
 @@ -179,18 +184,16 @@ public String fullName() {
 
   @Override
   public String toString() {
-    StringBuilder buf = new StringBuilder()
+    StringBuilder builder = new StringBuilder()
         .append("[")
         .append(getClass().getSimpleName())
         .append(" ");
-    boolean first = true;
-    for (ColumnMetadata md : nameSpace) {
-      if (! first) {
-        buf.append(", ");
-      }
-      buf.append(md.toString());
-    }
-    buf.append("]");
-    return buf.toString();
+
+    builder.append(nameSpace.entries().stream()
+      .map(ColumnMetadata::toString)
+      .collect(Collectors.joining(", ")));
 
 Review comment:
   Show off! That's some fancy functional code for such a simple task... Much 
cleaner.

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

Reply via email to