[
https://issues.apache.org/jira/browse/BEAM-10861?focusedWorklogId=575583&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-575583
]
ASF GitHub Bot logged work on BEAM-10861:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Apr/21 16:12
Start Date: 01/Apr/21 16:12
Worklog Time Spent: 10m
Work Description: boyuanzz commented on a change in pull request #14384:
URL: https://github.com/apache/beam/pull/14384#discussion_r605780315
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubUnboundedSource.java
##########
@@ -1336,14 +1334,40 @@ public boolean getNeedsMessageId() {
@Override
public PCollection<PubsubMessage> expand(PBegin input) {
- return input
- .getPipeline()
- .begin()
- .apply(Read.from(new PubsubSource(this)))
- .apply(
- "PubsubUnboundedSource.Stats",
- ParDo.of(
- new StatsFn(pubsubFactory, subscription, topic,
timestampAttribute, idAttribute)));
+ SerializableFunction<byte[], PubsubMessage> function;
+ if (getNeedsAttributes() || getNeedsMessageId()) {
+ function = new PubsubMessages.ParsePubsubMessageProtoAsPayload();
+ } else {
+ function = new DeserializeBytesIntoPubsubMessagePayloadOnly();
+ }
+ PCollection<PubsubMessage> messages =
+ input
+ .getPipeline()
+ .begin()
+ .apply(Read.from(new PubsubSource(this)))
+ .apply(
+ "MapBytesToPubsubMessages",
+
MapElements.into(TypeDescriptor.of(PubsubMessage.class)).via(function));
+ if (usesStatsFn(input.getPipeline().getOptions())) {
+ checkArgument(false);
Review comment:
Yeah...I'll remove these and fix the tests. Will let you know it's ready.
--
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: 575583)
Time Spent: 30h 40m (was: 30.5h)
> Adds URNs and payloads to PubSub transforms
> -------------------------------------------
>
> Key: BEAM-10861
> URL: https://issues.apache.org/jira/browse/BEAM-10861
> Project: Beam
> Issue Type: New Feature
> Components: cross-language, runner-dataflow, sdk-py-core
> Reporter: Chamikara Madhusanka Jayalath
> Assignee: Boyuan Zhang
> Priority: P1
> Time Spent: 30h 40m
> Remaining Estimate: 0h
>
> This is needed to allow runners to override portable definition of transforms.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)