[
https://issues.apache.org/jira/browse/BEAM-7174?focusedWorklogId=240720&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-240720
]
ASF GitHub Bot logged work on BEAM-7174:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/May/19 06:37
Start Date: 12/May/19 06:37
Worklog Time Spent: 10m
Work Description: robinyqiu commented on pull request #8425: [BEAM-7174]
Add schema modification transforms
URL: https://github.com/apache/beam/pull/8425#discussion_r281779851
##########
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:
If there are multiple sub-descriptors under a same field (e.g. a.b and a.c),
won't this return something like "a.b, c"?
To make the string looks prettier, how about we simply add a bracket around
sub-descriptor if it does not referencesSingleField (i.e. return something like
"a.[b, c]")?
----------------------------------------------------------------
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: 240720)
> 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: 50m
> 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)