msbukal commented on a change in pull request #13786:
URL: https://github.com/apache/beam/pull/13786#discussion_r562930537
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIO.java
##########
@@ -1488,6 +1490,20 @@ private Result(PCollectionTuple pct) {
* @return the resources
*/
public PCollection<JsonArray> getResources() {
+ return resources
+ .apply(
+ "Extract Values",
+ MapElements.into(TypeDescriptor.of(JsonArray.class))
+ .via((KV<String, JsonArray> in) -> in.getValue()))
+ .setCoder(JsonArrayCoder.of());
+ }
Review comment:
Yeah, I was debating if it was better to have 2 PCollections or to have
multiple transforms.
If we're going to store both keyed (PCollection<KV<String, JsonArray>>) &
unkeyed (PCollection\<JsonArray\>) resources in the Search.Result, is it better
to just create both in the constructor? Or only populate unkeyed if
getResources() has been called?
I believe the first would keep the MapElements step as part of the
FhirIO.Search operation, but the second would still add a (single?) extra
MapElements to a user's pipeline.
----------------------------------------------------------------
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]