wombatu-kun commented on code in PR #11747:
URL: https://github.com/apache/hudi/pull/11747#discussion_r1711321249


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -1017,9 +1017,19 @@ private static Object 
rewriteRecordWithNewSchemaInternal(Object oldRecord, Schem
   public static String createFullName(Deque<String> fieldNames) {
     String result = "";
     if (!fieldNames.isEmpty()) {
-      List<String> parentNames = new ArrayList<>();
-      fieldNames.descendingIterator().forEachRemaining(parentNames::add);
-      result = parentNames.stream().collect(Collectors.joining("."));
+      Iterator<String> iter = fieldNames.descendingIterator();
+      result = iter.next();
+      if (!iter.hasNext()) {
+        return result;
+      }
+
+      StringBuilder sb = new StringBuilder();
+      sb.append(result);
+      while (iter.hasNext()) {
+        sb.append(".");
+        sb.append(iter.next());
+      }
+      result = sb.toString();

Review Comment:
   > Does this logic have a significant impact on performance? If not, the 
original implementation might offer better readability.
   ![Screenshot from 2024-08-09 
18-46-26](https://github.com/user-attachments/assets/3372c8cb-c524-402d-b810-8e200124a523)
   
   
   



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to