Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: PubsubMessageWithTopicCoder.of() returns PubsubMessageWithAttributesAndMessageIdCoder #31679

Open
1 of 16 tasks
stankiewicz opened this issue Jun 24, 2024 · 1 comment · May be fixed by #31619
Open
1 of 16 tasks
Assignees

Comments

@stankiewicz
Copy link
Contributor

What happened?

PubsubMessageWithTopicCoder should return PubsubMessageWithTopicCoder while it returns PubsubMessageWithAttributesAndMessageIdCoder

While investigating Dynamic Destinations on Direct runner I found out that PubsubMessageWithTopicCoder is never used and topic is lost and pipeline fails.

repro:

        final PCollection<PubsubMessage> recordsWithTopics =
                events.apply("Build Record", ParDo.of(new BuildRecord())).setCoder(
                    PubsubMessageWithTopicCoder.of());
        System.out.println(recordsWithTopics.getCoder());
        recordsWithTopics.apply("Send to consumers", PubsubIO.writeMessagesDynamic());

issue:
KVCoder throws "cannot encode a null KV", difficult to debug.

workaround - use constructor:

        final PCollection<PubsubMessage> recordsWithTopics =
                events.apply("Build Record", ParDo.of(new BuildRecord())).setCoder(
                    new PubsubMessageWithTopicCoder());
        System.out.println(recordsWithTopics.getCoder());
        recordsWithTopics.apply("Send to consumers", PubsubIO.writeMessagesDynamic());

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
@stankiewicz
Copy link
Contributor Author

.take-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant