[ 
https://issues.apache.org/jira/browse/BEAM-7174?focusedWorklogId=241730&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241730
 ]

ASF GitHub Bot logged work on BEAM-7174:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/May/19 14:12
            Start Date: 14/May/19 14:12
    Worklog Time Spent: 10m 
      Work Description: reuvenlax commented on pull request #8425: [BEAM-7174] 
Add schema modification transforms
URL: https://github.com/apache/beam/pull/8425#discussion_r283819582
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldAccessDescriptor.java
 ##########
 @@ -513,4 +549,22 @@ private static void validateFieldDescriptor(Schema 
schema, FieldDescriptor field
       }
     }
   }
+
+  @Override
+  public String toString() {
+    if (getAllFields()) {
+      return "*";
+    }
+
+    List<String> singleSelectors =
+        getFieldsAccessed().stream()
+            .map(FieldDescriptor::getFieldName)
+            .collect(Collectors.toList());
+    List<String> nestedSelectors =
+        getNestedFieldsAccessed().entrySet().stream()
+            .map(e -> e.getKey().getFieldName() + "." + 
e.getValue().toString())
 
 Review comment:
   Current if you have a.b and a.c, this with return a.b, a.c.
   We could make it return a.[b,c], but it might get confusing for multiple 
nested descriptors? For example then a.b.c.d, a.b.c.e, a.c.f, a.g 
   
   will be printed as  a.[b.[c.[d, e] , f], g]
   
   Where it's probably more readable as simply a.b.c.d, a.b.c.e, a.c.f, a.g 
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 241730)
    Time Spent: 2h  (was: 1h 50m)

> Add transforms for modifying schemas
> ------------------------------------
>
>                 Key: BEAM-7174
>                 URL: https://issues.apache.org/jira/browse/BEAM-7174
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-core
>            Reporter: Reuven Lax
>            Assignee: Reuven Lax
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> We need transforms to add fields, remove fields, and rename fields.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to